dotnet-sdk-5.0 not found on Ubuntu 20.04.2 LTS

I'm currently using the net core 3.1 and want to upgrade it to 5.0. I tried following this guide from Install the .NET SDK or the .NET Runtime on Ubuntu

wget -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update; \ sudo apt-get install -y apt-transport-https && \ sudo apt-get update && \ sudo apt-get install -y dotnet-sdk-5.0

but looks like the dotnet-sdk-5.0 is not found

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

A quick cache dump only returns old versions:

➜ ~ sudo apt-cache dump | grep dotnet-sdk
Package: dotnet-sdk-2.2
Package: dotnet-sdk-3.1

It works just fine for my laptop also running 20.04, but not on this desktop. Weird. Did I miss anything?

2

3 Answers

I had the same error on Ubuntu. Running these solved the problem:

wget -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y aspnetcore-runtime-5.0

So, I was able to, finally, install version 5 by adding the repo for 20.04

sudo apt-add-repository 

While the installation successful, there were still some errors

E: The repository ' disco Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Skipping acquisition of configured file 'main/binary-i386/Packages', as repository ' focal InRelease' doesn't support architecture 'i386'
1

You may be a case listed under APT troubleshooting, and that is a possible difference between your laptop and desktop.

Try for instance the instructions to Install the .NET SDK or the .NET Runtime with Snap.

It is also useful if you post details on your laptop and desktop (brand, model, etc.)

Related:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like