How to install dotnet SDK on Ubuntu 16.04 LTS

Aerophilic picture Aerophilic · Feb 10, 2018 · Viewed 10.6k times · Source

I have been following the instructions provided here: https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x

However, I keep getting the error when I try to run"

sudo apt-get install dotnet-sdk-2.1.4

Specifically it says:

E: Unable to locate package dotnet-sdk-2.1.4
E: Couldn't find any package by glob 'dotnet-sdk-2.1.4'
E: Couldn't find any package by regex 'dotnet-sdk-2.1.4'

However, doing a sudo apt search dotnet results in the package showing up.

Am I doing something wrong?

Answer

Ali Nobari picture Ali Nobari · Mar 2, 2018

Try running this command on your terminal:

wget -q packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

Then update your system:

sudo apt-get update

Finally, run the command to install .NET

sudo apt-get install dotnet-sdk-2.1.4

Hope that helps!