3
votes

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)?

2

2 Answers

6
votes

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

4
votes

It seems to work if you use 18.04 packages.

In /etc/apt/sources.list put:

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

Then run:

sudo apt-get update
sudo apt-get install dotnet-sdk-2.1

Note: Ubuntu distributions require the following libraries installed:

liblttng-ust0
libcurl3
libssl1.0.0
libkrb5-3
zlib1g
libicu52 (for 14.x)
libicu55 (for 16.x)
libicu57 (for 17.x)
libicu60 (for 18.x)

see: https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites