Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to locate package dotnet-sdk-8.0

I've moved of my applications to .Net 8 and I use ubuntu 22.04.3 LTS VPS to host my web applications.

I'm trying to install .net 8 on the VPS but I can't

I've tried the Scripted install by microsoft it didn't work

I've tried the Debian install by microsoft it didn't work

When I run the basic command for ubuntu

sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-8.0

I get the following errer even after updating & Upgrading ubuntu

enter image description here

like image 302
omar wasfi Avatar asked Sep 02 '25 01:09

omar wasfi


1 Answers

Was in the same boat and between multiple GitHub posts for past releases was able to figure this out. Looks like dotnet-sdk-8.0 is not part of official Linux package so have to jump through a few hoops.

First use "sudo apt-get remove" command to remove the currently installed dotnet-sdk, dotnet-runtime and dotnet-host.

Then run the following command to add microsoft package source.

wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb

Now you can run commands to install the new dotnet-host (on dotnet 8) and dotnet-sdk.

sudo apt-get update
sudo apt-get install -y dotnet-host
sudo apt-get install -y dotnet-sdk-8.0

If you get any conflicts on install with existing installed packages, you have to uninstall those packages first.

like image 172
Dmitri M Avatar answered Sep 04 '25 19:09

Dmitri M