I have been following the instructions provided here: https://learn.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?
. NET is supported on Ubuntu. This article describes how to install .
You can see both the SDK versions and runtime versions with the command dotnet --info .
NET are installed to the normal C:\Program Files\dotnet\ folder. However, when you install the x64 version of . NET 6 SDK, it's installed to the C:\Program Files\dotnet\x64\ folder.
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!
Ensure you're running the prerequisite commands also:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
And finally:
sudo apt-get update
sudo apt-get install dotnet-sdk-2.1.4
Looks as if the deb package to set up the apt repo has some issues. As a quick fix do after installing the ms repo setup package:
sudo cp \
/etc/apt/sources.list.d/microsoft-prod.list.save \
/etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update
sudo apt-get install dotnet-sdk-2.1
Fix worked on ubuntu 18.04 but seems to be the same issue here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With