28

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.

Amir
  • 1,855
  • 3
  • 24
  • 40

4 Answers4

48

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
 
Derviş Kayımbaşıoğlu
  • 28,492
  • 4
  • 50
  • 72
  • 1
    I followed the exact step you provided but only changed on the last command for version 2.2: sudo apt-get install dotnet-sdk-2.2 and it worked for me. You could update your answer with this change. Maybe helpful for others too. Thank you. – Amir Jan 06 '19 at 21:29
  • I see this issue asks about ubuntu 18.04 specifically, but I didn't pay attention to having a different version and the code didn't work for me until I updated the `sources.list.d` modification to the ubuntu release I have. It would be helpful if that was pointed out. – hansmbakker Nov 07 '19 at 11:52
  • I had the same issue in net core 3.1 and it also works, thanks. – José Polanco Jul 04 '20 at 14:22
  • This worked for me as I needed to add dotnet sdk 2.2 to a dockerfile, to support older builds in our devops workflows, thanks for the share – leeroya Jul 11 '21 at 19:42
8

solution here Download and install libicu..

Dutch Glory
  • 23,373
  • 1
  • 17
  • 6
4

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.

  • In Linux 20.04 , even i can't install libssl1.0.0 but with only installing libicu57 , I can install dotnet-sdk-2.2 successfully. thanks – Ehsan Ehsani Jul 12 '20 at 10:22
1

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
Amin Golmahalleh
  • 3,585
  • 2
  • 23
  • 36