runtime: Can't install latest dotnet-sdk in Windows Subsystem for Linux

Steps to reproduce

  1. Install older .NET SDK (in my case I have a working 2.1.0-rc1 though I believe we’ve seen similar issues with older versions prior to 2.1 and trying to upgrade those as well. Those issues only resolved with using aptitude, though I haven’t done that yet on this system)

  2. Try to install the latest as per: https://www.microsoft.com/net/learn/get-started/linux/ubuntu16-04

wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb sudo apt-get install apt-transport-https sudo apt-get update sudo apt-get install dotnet-sdk-2.1

Expected behavior

2.1 should install 😃

Actual behavior

Fails on the install dotnet-sdk-2.1 command

adam@home:/mnt/c/Users/Adam$ sudo apt-get install dotnet-runtime-2.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
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-runtime-2.1 : Depends: dotnet-runtime-deps-2.1 (>= 2.1.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Environment data

Windows 10 Pro - 17134 (and prior) Ubuntu 16.04 Windows subsystem that seemingly has been working ok

dotnet --info returns the following

`.NET Core SDK (reflecting any global.json): Version: 2.1.300-rc1-008673 Commit: f5e3ddbe73

Runtime Environment: OS Name: ubuntu OS Version: 16.04 OS Platform: Linux RID: ubuntu.16.04-x64 Base Path: /usr/share/dotnet/sdk/2.1.300-rc1-008673/

Host (useful for support): Version: 2.1.0-rc1 Commit: eb9bc92051

.NET Core SDKs installed: 1.0.4 [/usr/share/dotnet/sdk] 2.1.4 [/usr/share/dotnet/sdk] 2.1.300-rc1-008673 [/usr/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.0-rc1-final [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0-rc1-final [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0-preview1-26216-03 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0-rc1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download adam@home:/mnt/c/Users/Adam$ dotnet --info .NET Core SDK (reflecting any global.json): Version: 2.1.300-rc1-008673 Commit: f5e3ddbe73

Runtime Environment: OS Name: ubuntu OS Version: 16.04 OS Platform: Linux RID: ubuntu.16.04-x64 Base Path: /usr/share/dotnet/sdk/2.1.300-rc1-008673/

Host (useful for support): Version: 2.1.0-rc1 Commit: eb9bc92051

.NET Core SDKs installed: 1.0.4 [/usr/share/dotnet/sdk] 2.1.4 [/usr/share/dotnet/sdk] 2.1.300-rc1-008673 [/usr/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.0-rc1-final [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0-rc1-final [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0-preview1-26216-03 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0-rc1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

`

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 25 (4 by maintainers)

Most upvoted comments

at what step did the error occur?

Thank you for asking @blackrek

  1. sudo apt-get autoremove dotnet-host
  2. sudo rm -rf /usr/share/dotnet/
  3. wget http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu60_60.2-6ubuntu1_amd64.deb dpkg -i libicu60_60.2-6ubuntu1_amd64.deb

Also http://mirrors.edge.kernel.org/ubuntu/pool/main/i/icu/ is not found

This answer worked for me, but I had to break step 3 into to parts: 3a. wget http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu60_60.2-6ubuntu1_amd64.deb 3b. sudo dpkg -i libicu60_60.2-6ubuntu1_amd64.deb

  1. sudo apt-get install dotnet-sdk-2.1 Output: Reading package lists… Done Building dependency tree Reading state information… Done The following additional packages will be installed: aspnetcore-runtime-2.1 dotnet-host dotnet-hostfxr-2.1 dotnet-runtime-2.1 dotnet-runtime-deps-2.1 liblttng-ust-ctl2 liblttng-ust0 liburcu4 The following NEW packages will be installed: aspnetcore-runtime-2.1 dotnet-host dotnet-hostfxr-2.1 dotnet-runtime-2.1 dotnet-runtime-deps-2.1 dotnet-sdk-2.1 liblttng-ust-ctl2 liblttng-ust0 liburcu4 0 upgraded, 9 newly installed, 0 to remove and 107 not upgraded. Need to get 131 MB of archives. After this operation, 378 MB of additional disk space will be used. Do you want to continue? [Y/n] Y … Welcome to .NET Core!

To get it to install on Ubuntu 18.04 I had to run the following before attempting the dotnet-sdk-2.1 install: wget http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb sudo sudo dpkg -i libicu55_55.1-7_amd64.deb

Installing libicu60 didn’t resolve the missing dependency for me.

fixed for ubuntu server 18.04 for dotnet-sdk-2.1

  1. remove old version (thx @leecow comments):

sudo apt-get autoremove dotnet-host starts at the bottom of the dependency tree rather than the top and will do most of the work. sudo rm -rf /usr/share/dotnet/ to clear up the remaining things in the sdk/ directory.

  1. fix @jefking instructions (replace package version for libicu60): wget http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu60_60.2-6ubuntu1_amd64.deb dpkg -i libicu60_60.2-6ubuntu1_amd64.deb

(if you need other version of libicu, just found it in http://mirrors.edge.kernel.org/ubuntu/pool/main/i/icu/)

  1. now apt-get install dotnet-sdk-2.1 works!

today installed 2.1.302 version thx all!

Fixed my issue above

Found this: No installation candidate for “libicu52” on 15.10

Ran

wget http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu52_52.1-3ubuntu0.8_amd64.deb
dpkg -i libicu52*.deb

Then

sudo apt-get install dotnet-sdk-2.1

dotnet

root@DESKTOP-74N9G6D:~# dotnet

Usage: dotnet [options]
Usage: dotnet [path-to-application]

Options:
  -h|--help         Display help.
  --info            Display .NET Core information.
  --list-sdks       Display the installed SDKs.
  --list-runtimes   Display the installed runtimes.

path-to-application:
  The path to an application .dll file to execute.

Looks like some package wiring was missing, but specifying a few transitive deps explicitly seemed to work for me…

#!/bin/bash wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb wget http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb sudo dpkg -i packages-microsoft-prod.deb sudo dpkg -i libicu55_55.1-7_amd64.deb sudo add-apt-repository universe sudo apt-get install -y apt-transport-https sudo apt-get update sudo apt-get install -y dotnet-sdk-2.1 dotnet-runtime-2.1 aspnetcore-runtime-2.1 dotnet-runtime-deps-2.1 libicu55

I also had the same error as CoskunSunali. …

Are not these additional steps better to be a part of the documentation at https://dotnet.microsoft.com/download/linux-package-manager/ubuntu18-04/sdk-2.2.105 or even better set as dependencies so apt or apt-get installs them automatically?

It is 2019 and we have to search through Google to figure out how to install dotnet-sdk using a package manager. Feels sad.

By the way, even after invoking the workaround commands, it fails.

coskun@cs:~$ sudo dpkg -i libicu60_60.2-6ubuntu1_amd64.deb
Selecting previously unselected package libicu60:amd64.
(Reading database ... 139489 files and directories currently installed.)
Preparing to unpack libicu60_60.2-6ubuntu1_amd64.deb ...
Unpacking libicu60:amd64 (60.2-6ubuntu1) ...
Setting up libicu60:amd64 (60.2-6ubuntu1) ...
Processing triggers for libc-bin (2.29-0ubuntu1) ...

coskun@cs:~$ sudo apt-get install dotnet-sdk-2.2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
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.3) but it is not going to be installed
                  Depends: dotnet-runtime-2.2 (>= 2.2.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

@EdenRidgway thanks! your solution worked for me. sudo wget http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb

Actually this version is what solves the issue for ubuntu 18.

I am having this same issue–I have rc1 installed (using aptitude because apt-get failed) and am now attempting to install 2.1 using sudo apt-get install dotnet-sdk-2.1. This errored out with the same message on both my laptop (Surface) and my personal desktop (also Windows) on Ubuntu/bash. As noted above, worked fine using aptitude, a solution proposed in this post by someone having the same problem: https://askubuntu.com/questions/363200/e-unable-to-correct-problems-you-have-held-broken-packages/451078. While this is a functional workaround, it would be nice to know what is going on here as it seems like the problem is occurring for a number of WSL users.