Can't install latest dotnet-sdk in Windows Subsystem for Linux
Steps to reproduce
-
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)
-
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
`
I confirmed this works OK on a clean Ubuntu WSL setup. We did make an update to package dependencies between RC and the final release so I'm wondering if that's causing this issue? You can sudo apt autoremove aspnetcore-runtime-2.1.0-rc1-final to clean out the RC runtime pieces or go all the way to the top and remove from the SDK with sudo apt autoremove dotnet-sdk-2.1.300-rc1-008673. Then, install the final 2.1 release.
After running
sudo apt autoremove aspnetcore-runtime-2.1.0-rc1-final
Same issue.
dotnet --info shows I have 1.0.4 but new install fails.
.NET Command Line Tools (1.0.4)
Product Information:
Version: 1.0.4
Commit SHA-1 hash: af1e6684fd
Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64
Base Path: /usr/share/dotnet/sdk/1.0.4
Microsoft .NET Core Shared Framework Host
Version : 2.1.0-preview1-26216-03
Build : f2c3216183d20416568a4bbf5bb7d153e826f153
So only 1.0.4 is left but I get the same problem as before. We've had some weird issues on WSL upgrading. A coworker (@jackiebecker) in this exact same scenario had success with aptitude (apt-get install aptitude).
I tried it with aptitude, note that you have to select NO for it to continue with install (we're so use to saying 'yes' for installs). This seems to work ok. @leecow any thoughts as to why apt-get would fail here? We've seen this on several systems.
The following NEW packages will be installed:
aspnetcore-runtime-2.1{a} dotnet-hostfxr-2.1{a} dotnet-runtime-2.1{a} dotnet-runtime-deps-2.1{ab} dotnet-sdk-2.1
0 packages upgraded, 5 newly installed, 0 to remove and 42 not upgraded.
Need to get 130 MB of archives. After unpacking 375 MB will be used.
The following packages have unmet dependencies:
dotnet-runtime-deps-2.1 : Depends: libicu52 which is a virtual package and is not provided by any available package.
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) aspnetcore-runtime-2.1 [Not Installed]
2) dotnet-runtime-2.1 [Not Installed]
3) dotnet-runtime-deps-2.1 [Not Installed]
4) dotnet-sdk-2.1 [Not Installed]
Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:
Install the following packages:
1) dotnet-runtime-deps-2.1 [2.1.0-1 (xenial)]
Accept this solution? [Y/n/q/?] Y
The following NEW packages will be installed:
aspnetcore-runtime-2.1{a} dotnet-hostfxr-2.1{a} dotnet-runtime-2.1{a} dotnet-runtime-deps-2.1{a} dotnet-sdk-2.1
0 packages upgraded, 5 newly installed, 0 to remove and 42 not upgraded.
Need to get 130 MB of archives. After unpacking 375 MB will be used.
Do you want to continue? [Y/n/?] Y
Get: 1 https://packages.microsoft.com/ubuntu/16.04/prod xenial/main amd64 dotnet-runtime-deps-2.1 amd64 2.1.0-1 [2,600 B]
Get: 2 https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty/main amd64 dotnet-hostfxr-2.1 amd64 2.1.0-1 [143 kB]
Get: 3 https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty/main amd64 dotnet-runtime-2.1 amd64 2.1.0-1 [20.3 MB]
Get: 4 https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty/main amd64 aspnetcore-runtime-2.1 amd64 2.1.0-1 [22.1 MB]
Get: 5 https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty/main amd64 dotnet-sdk-2.1 amd64 2.1.300-1 [87.5 MB]
Fetched 130 MB in 1min 22s (1,578 kB/s)
Selecting previously unselected package dotnet-runtime-deps-2.1.
(Reading database ... 40576 files and directories currently installed.)
Preparing to unpack .../dotnet-runtime-deps-2.1_2.1.0-1_amd64.deb ...
Unpacking dotnet-runtime-deps-2.1 (2.1.0-1) ...
Selecting previously unselected package dotnet-hostfxr-2.1.
Preparing to unpack .../dotnet-hostfxr-2.1_2.1.0-1_amd64.deb ...
Unpacking dotnet-hostfxr-2.1 (2.1.0-1) ...
Selecting previously unselected package dotnet-runtime-2.1.
Preparing to unpack .../dotnet-runtime-2.1_2.1.0-1_amd64.deb ...
Unpacking dotnet-runtime-2.1 (2.1.0-1) ...
Selecting previously unselected package aspnetcore-runtime-2.1.
Preparing to unpack .../aspnetcore-runtime-2.1_2.1.0-1_amd64.deb ...
Unpacking aspnetcore-runtime-2.1 (2.1.0-1) ...
Selecting previously unselected package dotnet-sdk-2.1.
Preparing to unpack .../dotnet-sdk-2.1_2.1.300-1_amd64.deb ...
Unpacking dotnet-sdk-2.1 (2.1.300-1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up dotnet-runtime-deps-2.1 (2.1.0-1) ...
Setting up dotnet-hostfxr-2.1 (2.1.0-1) ...
Setting up dotnet-runtime-2.1 (2.1.0-1) ...
Setting up aspnetcore-runtime-2.1 (2.1.0-1) ...
Setting up dotnet-sdk-2.1 (2.1.300-1) ...
This software may collect information about you and your use of the software, and send that to Microsoft.
Please visit http://aka.ms/dotnet-cli-eula for more information.
Welcome to .NET Core!
---------------------
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.
@leecow Any thoughts on how we can get to the root issue here?
I have seen various apt clients deal with dependency resolutions differently though I can't say why that is. Will find Rich Turner's handle and add him to this thread to see if there's anything on the WSL side that could be thought about.
While it's a bit of a hammer, completely cleaning .NET Core out of the system then reinstalling the needed versions has gotten me out of any weird state I've managed to get myself into.
sudo apt-get autoremove dotnet-hoststarts 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.- reinstall the release versions you need to work with. Remember that newer versions of the SDK can be used to build for older versions of the runtime so latest released SDK (2.1.301 at the moment which is installed by the dotnet-sdk-2.1 package) should be all that you need.
I am also having this issue. I don't believe I have ever had dotnet installed in WSL on this laptop. Windows is up-to-date. Version:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
Run dotnet:
dotnet: command not found
Installation (Like Above):
root@DESKTOP-74N9G6D:/mnt/c/Users/jking/Documents/GitHub# wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
root@DESKTOP-74N9G6D:/mnt/c/Users/jking/Documents/GitHub# sudo dpkg -i packages-microsoft-prod.deb
(Reading database ... 36796 files and directories currently installed.)
Preparing to unpack packages-microsoft-prod.deb ...
Unpacking packages-microsoft-prod (1.0-3) over (1.0-3) ...
Setting up packages-microsoft-prod (1.0-3) ...
root@DESKTOP-74N9G6D:/mnt/c/Users/jking/Documents/GitHub# sudo apt-get install apt-transport-https
Reading package lists... Done
Building dependency tree
Reading state information... Done
apt-transport-https is already the newest version (1.2.26).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
root@DESKTOP-74N9G6D:/mnt/c/Users/jking/Documents/GitHub# sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Hit:4 https://deb.nodesource.com/node_8.x xenial InRelease
Hit:5 https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty InRelease
Hit:6 https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease
Fetched 216 kB in 5s (36.0 kB/s)
Reading package lists... Done
root@DESKTOP-74N9G6D:/mnt/c/Users/jking/Documents/GitHub# sudo apt-get install dotnet-sdk-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-sdk-2.1 : Depends: dotnet-runtime-2.1 (>= 2.1.1) but it is not going to be installed
Depends: aspnetcore-runtime-2.1 (>= 2.1.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Running up the dependency chain:
root@DESKTOP-74N9G6D:/mnt/c/Users/jking/Documents/GitHub# 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.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@DESKTOP-74N9G6D:/mnt/c/Users/jking/Documents/GitHub# sudo apt-get install dotnet-runtime-deps-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-deps-2.1 : Depends: libicu52 but it is not installable
E: Unable to correct problems, you have held broken packages.
root@DESKTOP-74N9G6D:/mnt/c/Users/jking/Documents/GitHub# sudo apt-get install libicu52
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libicu52 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libicu52' has no installation candidate
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.
fixed for ubuntu server 18.04 for dotnet-sdk-2.1
- remove old version (thx @leecow comments):
sudo apt-get autoremove dotnet-hoststarts 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.
- 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/)
- now
apt-get install dotnet-sdk-2.1works!
today installed 2.1.302 version thx all!
Awesome to see some successes in this thread :-). @jackiebecker, have you been able to get up and running with 2.1? If not, have you tried a complete clean up as described above (https://github.com/dotnet/core-setup/issues/4247#issuecomment-400686996)?
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
- remove old version (thx @leecow comments):
sudo apt-get autoremove dotnet-hoststarts 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.
- 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/)
- now
apt-get install dotnet-sdk-2.1works!today installed 2.1.302 version thx all!
It got stuck on the line Connecting to 2.0 (2.0)|2.0.0.0|:80... Unsuccessfully retrying
at what step did the error occur?
at what step did the error occur?
Thank you for asking @blackrek
-
sudo apt-get autoremove dotnet-host
-
sudo rm -rf /usr/share/dotnet/
-
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
Try proxy. I have access to this resources
@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.
Try proxy. I have access to this resources
I've tried installing libicu60_60.2-6ubuntu1_i386.deb Which I got from from http://mirrors.edge.kernel.org/ubuntu/pool/main/i/icu/ And I got the following: Error: Dependency is not satisfiable: libgcc1 (>= 1:7)
This helped me get installed to 2.1.3, but I'm back again because I'm trying to upgrade to 2.1.4, and getting nowhere. All instructions I've found says to use
apt-get install dotnet-sdk-2.1
This installs 2.1.3 currently. So how do I upgrade to 2.1.4 (or 2.1.5 for that matter, which just came out?)
at what step did the error occur?
Thank you for asking @blackrek
- sudo apt-get autoremove dotnet-host
- sudo rm -rf /usr/share/dotnet/
- 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
- 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!
Make sure you are not in a NTFS directory when you grab the deb. i.e. not in a mounted drive like /mnt/c/???, first cd to ~/ then follow the install instructions. This solved this issue for me. Hope this helps!
Just install this .deb package https://packages.ubuntu.com/ru/xenial/libicu55