Cannot install .Net Core 2.2 on UBuntu 18.04

Viewed 13461

I was trying to deploy an ASP.NET Core 2.2 application to a DigitalOcean droplet running Ubuntu 18.04. I followed the steps provided on the official documentation.

But I am getting the error.

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 dotnet-sdk-2.2 : Depends: aspnetcore-runtime-2.2 (>= 2.2.0) but it is not going to be installed
                  Depends: dotnet-runtime-2.2 (>= 2.2.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

  

Any help? I tried to get help from other forums and SO answer still no luck.

4 Answers

this is a known issue on GitHub

Developers have suggested different solutions as per my knowledge. I Suggest you to check the link.

The problem generally happends on the lack of libicu. where is the version of libicu.

Below is the suggested solution for the version of DotNet-Core Sdk dotnet-sdk-2.2

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-bionic-prod bionic main" > /etc/apt/sources.list.d/dotnetdev.list'

sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2
 

I had this same problem. The above fix didn't really work for me. I had to download and install libicu57 and libssl1.0.0 for the command to run and install .net successfully.

libicu57
libssl1.0.0

Download the specific version of .net sdk,yours might be different.

After installing, run

sudo apt-get install dotnet-sdk-2.2

Hope this helps.

I copied the list manually and it worked:

wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update

sudo apt-get install dotnet-sdk-2.2
Related