Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install DotNet CLI tools on Ubuntu 18.10? (for VScode)

I've followed the instructions on here to install the DotNet-CLI tools as requested by VScode. The page doesn't currently have Ubuntu 18.10 listed, so I altered a file inside /etc/apt to have the following line:

deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.10/prod cosmic main

I've checked the URL, and does seem valid. I then do a sudo apt update and then try to install the dotnet-sdk as described on the above site, but it can't find the package.

sudo apt search dotnet-sdk

does not show anything either.

While searching for help, I tried using the 'snap' method, but that just puts me in a loop:

$dotnet
Command 'dotnet' not found, but can be installed with:
sudo snap install dotnet-sdk

$sudo snap install dotnet-sdk
snap "dotnet-sdk" is already installed, see 'snap help refresh'
$snap refresh
dotnet-sdk 2.1.403 from Microsoft .NET Core (dotnetcore✓) refreshed

$dotnet
Command 'dotnet' not found, but can be installed with:
sudo snap install dotnet-sdk

So, anyone know how to install this for 18.10 (cosmic)?

like image 536
Scott Hather Avatar asked Dec 18 '22 20:12

Scott Hather


1 Answers

If you happen to use snap, the command is actually called dotnet-sdk.dotnet. But an alias can be set up:

sudo snap alias dotnet-sdk.dotnet dotnet

Found here: https://askubuntu.com/questions/1131867/dotnet-command-not-found-after-installing-using-snap

like image 129
Thomas Glaser Avatar answered Dec 20 '22 10:12

Thomas Glaser