question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot install dotnet SDK on Ubuntu 21.04

See original GitHub issue

So, I’ve been using .net core previously on Ubuntu. It was 3.1. I don’t remember how exactly it was installed but it worked perfectly.

Now when I’d reinstalled my system to Ubuntu 21.04 I was going to give .net 5.0 a try. Unfortunately all installation options mentioned on official Microsoft website (https://docs.microsoft.com/en-us/dotnet/core/install/linux) failed for me.

  • Snap installation itself worked fine. I was able to install .net 5.0. But almost any dotnet CLI call fails with Segmentation Fault. This seams to be a known issue, some people recommend to not use Snap for dotnet. It worths mentioning that I’ve also tried 3.1 channel and it gives the same result - segmentation fault.
  • My second option was to use install.sh, but this is not recommended for development environment installation, so I didn’t even try.
  • Some people on the internet recommend to use Microsoft PPA and to install deb packages. While this option is still present on official documentation (https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2104-), it seems like Microsoft team abandoned it’s PPA. https://packages.microsoft.com/config/ubuntu/21.04/packages-microsoft-prod.deb - gives 404. The same happens if I add PPA manually and try to install dotnet
$ sudo apt install  dotnet-sdk-5.0 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  aspnetcore-runtime-5.0 aspnetcore-targeting-pack-5.0 dotnet-apphost-pack-5.0 dotnet-host dotnet-hostfxr-5.0 dotnet-runtime-5.0 dotnet-runtime-deps-5.0 dotnet-targeting-pack-5.0
  netstandard-targeting-pack-2.1
The following NEW packages will be installed:
  aspnetcore-runtime-5.0 aspnetcore-targeting-pack-5.0 dotnet-apphost-pack-5.0 dotnet-host dotnet-hostfxr-5.0 dotnet-runtime-5.0 dotnet-runtime-deps-5.0 dotnet-sdk-5.0 dotnet-targeting-pack-5.0
  netstandard-targeting-pack-2.1
0 upgraded, 10 newly installed, 0 to remove and 24 not upgraded.
Need to get 95,1 MB of archives.
After this operation, 396 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Err:1 https://packages.microsoft.com/ubuntu/21.04/prod hirsute/main amd64 dotnet-runtime-deps-5.0 amd64 5.0.7-1
  404  Not Found [IP: 104.214.230.139 443]
Err:2 https://packages.microsoft.com/ubuntu/21.04/prod hirsute/main amd64 dotnet-host amd64 5.0.7-1
  404  Not Found [IP: 104.214.230.139 443]
Err:3 https://packages.microsoft.com/ubuntu/21.04/prod hirsute/main amd64 dotnet-hostfxr-5.0 amd64 5.0.7-1
  404  Not Found [IP: 104.214.230.139 443]
Err:4 https://packages.microsoft.com/ubuntu/21.04/prod hirsute/main amd64 dotnet-runtime-5.0 amd64 5.0.7-1
  404  Not Found [IP: 104.214.230.139 443]
Err:5 https://packages.microsoft.com/ubuntu/21.04/prod hirsute/main amd64 aspnetcore-runtime-5.0 amd64 5.0.7-1
  404  Not Found [IP: 104.214.230.139 443]
Err:6 https://packages.microsoft.com/ubuntu/21.04/prod hirsute/main amd64 dotnet-targeting-pack-5.0 amd64 5.0.0-1
  404  Not Found [IP: 104.214.230.139 443]
Err:7 https://packages.microsoft.com/ubuntu/21.04/prod hirsute/main amd64 aspnetcore-targeting-pack-5.0 amd64 5.0.0-1
  404  Not Found [IP: 104.214.230.139 443]
Err:8 https://packages.microsoft.com/ubuntu/21.04/prod hirsute/main amd64 dotnet-apphost-pack-5.0 amd64 5.0.7-1
  404  Not Found [IP: 104.214.230.139 443]
Err:9 https://packages.microsoft.com/ubuntu/21.04/prod hirsute/main amd64 netstandard-targeting-pack-2.1 amd64 2.1.0-1
  404  Not Found [IP: 104.214.230.139 443]
Err:10 https://packages.microsoft.com/ubuntu/21.04/prod hirsute/main amd64 dotnet-sdk-5.0 amd64 5.0.301-1
  404  Not Found [IP: 104.214.230.139 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/21.04/prod/pool/main/d/dotnet-runtime-deps-5.0/dotnet-runtime-deps-5.0.7-x64.deb  404  Not Found [IP: 104.214.230.139 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/21.04/prod/pool/main/d/dotnet-host/dotnet-host-5.0.7-x64.deb  404  Not Found [IP: 104.214.230.139 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/21.04/prod/pool/main/d/dotnet-hostfxr-5.0/dotnet-hostfxr-5.0.7-x64.deb  404  Not Found [IP: 104.214.230.139 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/21.04/prod/pool/main/d/dotnet-runtime-5.0/dotnet-runtime-5.0.7-x64.deb  404  Not Found [IP: 104.214.230.139 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/21.04/prod/pool/main/a/aspnetcore-runtime-5.0/aspnetcore-runtime-5.0.7-x64.deb  404  Not Found [IP: 104.214.230.139 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/21.04/prod/pool/main/d/dotnet-targeting-pack-5.0/dotnet-targeting-pack-5.0.0-x64.deb  404  Not Found [IP: 104.214.230.139 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/21.04/prod/pool/main/a/aspnetcore-targeting-pack-5.0/aspnetcore-targeting-pack-5.0.0.deb  404  Not Found [IP: 104.214.230.139 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/21.04/prod/pool/main/d/dotnet-apphost-pack-5.0/dotnet-apphost-pack-5.0.7-x64.deb  404  Not Found [IP: 104.214.230.139 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/21.04/prod/pool/main/n/netstandard-targeting-pack-2.1/netstandard-targeting-pack-2.1_2.1.0-1_amd64.deb  404  Not Found [IP: 104.214.230.139 443]
E: Failed to fetch https://packages.microsoft.com/ubuntu/21.04/prod/pool/main/d/dotnet-sdk-5.0/dotnet-sdk-5.0.301-x64.deb  404  Not Found [IP: 104.214.230.139 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

To summarize, I was not able to install ANY version of .net core using any of suggested approaches. So it there any way to install dotnet on Ubuntu?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:14

github_iconTop GitHub Comments

1reaction
stepanprokipchyncommented, Jun 18, 2021

I was finally able to install on my side. It was very slow and it interrupted a few times. Seems like the installed sdk is working, at least I don’t get Segfault

1reaction
ozonnicommented, Jun 17, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Install the .NET SDK or the .NET Runtime on Ubuntu
Demonstrates the various ways to install .NET SDK and .NET Runtime on Ubuntu.
Read more >
Install .NET SDK or .NET Runtime on Ubuntu 22.04
This article discusses how to install .NET on Ubuntu 22.04; .NET 6 and .NET 7 are supported. Install the SDK (which includes the...
Read more >
dotnet-sdk-5.0 not found on Ubuntu 20.04.2 LTS
Try for instance the instructions to Install the .NET SDK or the .NET Runtime with Snap. It is also useful if you post...
Read more >
How to install previous dotnet versions alongside latest ...
deb file first. wget https://packages.microsoft.com/config/ubuntu/21.04/packages-microsoft-prod.deb -O packages-microsoft- ...
Read more >
help with .NET snap. Can't run as normal user
Can't run as normal user. Theres another simple way. Code: sudo chown <user name> /snap/dotnet-sdk ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found