core icon indicating copy to clipboard operation
core copied to clipboard

Cannot install dotnet-sdk-2.1 on Ubuntu 18.04.1

Open JerryBian opened this issue 8 years ago • 27 comments

fail to install latest dotnet-sdk on Ubuntu 18.04.1

I just tried to install latest dotnet SDK 2.1 on fresh clean Ubuntu 18.04.1, well, it fails and I didn't find solution yet.

Details

I followed the official tutorial https://www.microsoft.com/net/learn/get-started-with-dotnet-tutorial, under Ubuntu 18.04 section.

jietu20180728-104449 jietu20180728-104725

Any idea?

JerryBian avatar Jul 28 '18 02:07 JerryBian

I'm getting this error on 18.04.1:

ngadmin@pocvm4:/tmp$ sudo dpkg -i packages-microsoft-prod.deb [sudo] password for ngadmin: (Reading database ... 208777 files and directories currently installed.) Preparing to unpack packages-microsoft-prod.deb ... Unpacking packages-microsoft-prod (1.0-ubuntu18.04.1) over (1.0-ubuntu18.04.1) ... Setting up packages-microsoft-prod (1.0-ubuntu18.04.1) ...

ngadmin@pocvm4:/tmp$ 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.6.3). 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. ngadmin@pocvm4:/tmp$ 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.6.3). 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

ngadmin@pocvm4:/tmp$ sudo apt-get update Hit:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease Hit:2 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease Hit:3 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease Hit:5 http://ppa.launchpad.net/nginx/stable/ubuntu bionic InRelease Reading package lists... Done

ngadmin@pocvm4:/tmp$ sudo apt-get update Hit:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease Hit:2 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease Hit:3 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease Hit:4 http://ppa.launchpad.net/nginx/stable/ubuntu bionic InRelease Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease Reading package lists... Done

ngadmin@pocvm4:/tmp$ sudo apt-get install aspnetcore-runtime-2.1 Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package aspnetcore-runtime-2.1 E: Couldn't find any package by glob 'aspnetcore-runtime-2.1' E: Couldn't find any package by regex 'aspnetcore-runtime-2.1'

mateti avatar Jul 29 '18 22:07 mateti

Hm, everything is definitely on the repo and working. From a quick test ...

leecow@lbc-1804:~$ cat /etc/apt/sources.list.d/microsoft-prod.list 
deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main

leecow@lbc-1804:~$ sudo apt install dotnet-sdk-2.1
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-ctl4 liblttng-ust0 liburcu6
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-ctl4 liblttng-ust0 liburcu6
0 upgraded, 9 newly installed, 0 to remove and 18 not upgraded.
Need to get 128 MB of archives.
After this operation, 375 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

@mateti - your apt-get update output is suspicious as package.microsoft.com is not listed among the hits.

@JerryBian - do you have any preview versions installed? There was an issue with previous packages getting in the way of dependency resolution. You can check this with apt search dotnet | grep installed

leecow avatar Jul 30 '18 17:07 leecow

@leecow thanks for you reply, but it seems something is still wrong.

jerry@ubuntu-server-0:~$ apt search dotnet | grep installed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

jerry@ubuntu-server-0:~$ cat /etc/apt/sources.list.d/microsoft-prod.list
deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main
jerry@ubuntu-server-0:~$ sudo apt install dotnet-sdk-2.1
[sudo] password for jerry:
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.2) but it is not going to be installed
                  Depends: aspnetcore-runtime-2.1 (>= 2.1.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

It should not has any previous version installed, since I downloaded latest version of Ubuntu from their portal and then followed your tutorial installing dotnet SDK then, nothing else did.

Do you need anything I check for you besides above?

JerryBian avatar Jul 31 '18 00:07 JerryBian

@JerryBian , can you please try installing dotnet-runtime-deps-2.1 and dotnet-runtime-2.1 package separately and share the log here?

rakeshsinghranchi avatar Jul 31 '18 02:07 rakeshsinghranchi

@rakeshsinghranchi please see following:

jerry@ubuntu-server-0:~$ sudo apt install dotnet-runtime-deps-2.1
[sudo] password for jerry:
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: liblttng-ust0 but it is not installable
E: Unable to correct problems, you have held broken packages.
jerry@ubuntu-server-0:~$ sudo apt install dontnet-runtime-2.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package dontnet-runtime-2.1
E: Couldn't find any package by glob 'dontnet-runtime-2.1'
E: Couldn't find any package by regex 'dontnet-runtime-2.1'

JerryBian avatar Jul 31 '18 10:07 JerryBian

This is strange - what happens with apt search liblttng-ust0. My 18.04.1 output is

leecow@lbc-1804:~$ apt search liblttng-ust0
Sorting... Done
Full Text Search... Done
liblttng-ust0/bionic,now 2.10.1-1 amd64 [installed,automatic]
  LTTng 2.0 Userspace Tracer (tracing libraries)

leecow avatar Jul 31 '18 17:07 leecow

Please share output of the following commands to help further diagnose the issue : apt-cache policy dotnet-runtime-deps-2.1 apt-cache policy dotnet-runtime-2.1

rakeshsinghranchi avatar Jul 31 '18 18:07 rakeshsinghranchi

@leecow

jerry@ubuntu-server-0:~$ apt search liblttng-ust0
Sorting... Done
Full Text Search... Done

@rakeshsinghranchi

jerry@ubuntu-server-0:~$ apt-cache policy dotnet-runtime-deps-2.1
dotnet-runtime-deps-2.1:
  Installed: (none)
  Candidate: 2.1.2-1
  Version table:
     2.1.2-1 500
        500 https://packages.microsoft.com/ubuntu/18.04/prod bionic/main amd64 Packages
     2.1.1-1 500
        500 https://packages.microsoft.com/ubuntu/18.04/prod bionic/main amd64 Packages
     2.1.0-1 500
        500 https://packages.microsoft.com/ubuntu/18.04/prod bionic/main amd64 Packages
jerry@ubuntu-server-0:~$ apt-cache policy dotnet-runtime-2.1
dotnet-runtime-2.1:
  Installed: (none)
  Candidate: 2.1.2-1
  Version table:
     2.1.2-1 500
        500 https://packages.microsoft.com/ubuntu/18.04/prod bionic/main amd64 Packages
     2.1.1-1 500
        500 https://packages.microsoft.com/ubuntu/18.04/prod bionic/main amd64 Packages
     2.1.0-1 500
        500 https://packages.microsoft.com/ubuntu/18.04/prod bionic/main amd64 Packages

P.S. my Ubuntu is server version, instead of desktop(GUI), though I couldn't see what's difference might be.

JerryBian avatar Jul 31 '18 21:07 JerryBian

So the fact that liblttng-us0 is not being presented to you is the problem. Looks like the package is probably in universe amd 64 which I don't see in your apt-get "Get" list. Here's the archive list I have on a pretty clean box with the default ubuntu repos active in /etc/apt/sources.list.

sudo apt-get update
Hit:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]          
Get:5 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                   
Get:6 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [247 kB] 
Get:7 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [268 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [138 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 48x48 Icons [31.4 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 64x64 Icons [53.7 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [153 kB]    
Get:12 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [204 B]
Get:13 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [152 kB]        
Get:14 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [149 kB]
Get:15 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [153 kB]
Get:16 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [263 kB]
Get:17 http://us.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,464 B]
Get:18 http://us.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [5,100 B]
Get:19 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [4,448 B]
Fetched 1,867 kB in 1s (1,748 kB/s)                                     
Reading package lists... Done

leecow avatar Jul 31 '18 22:07 leecow

Thanks very much, after I enabled universe repository everything is good.

JerryBian avatar Aug 01 '18 13:08 JerryBian

I'm glad this resolved the problem @JerryBian

@leecow should sudo add-apt-repository universe be added to the install instructions (or as a comment) for Ubuntu 18.04?

https://fabianlee.org/2016/09/18/ubuntu-enabling-the-ubuntu-universe-repository/

joshfree avatar Aug 01 '18 16:08 joshfree

@JerryBian, was Universe deliberately removed at some point? Don't think I've ever seen a default setup that didn't already include that.

@joshfree - Possibly as a general comment to the Linux Prereqs and Setup pages?

leecow avatar Aug 01 '18 16:08 leecow

@leecow Actually no, I just tried reinstall Ubuntu Server 18.04.1(ubuntu-18.04.1-live-server-amd64 .iso from portal) and I didn't find any step allow me to setup repository or something like that during the installation. After installed successfully, I checked that APT source list, and universe is not there just like before.

@joshfree Exactly, I executed that command before installing dotnet SDK.

JerryBian avatar Aug 01 '18 22:08 JerryBian

Thanks for the extra info @JerryBian - we'll note the need to look for this in Server image scenarios.

leecow avatar Aug 01 '18 22:08 leecow

Still having same issue.

alokraj68 avatar Oct 05 '18 12:10 alokraj68

I'm having the same issue when trying to update to the current version from dotnet 2.1.302 on Ubuntu 18.04.1. I have "universe" repository added. I tried installing dotnet-runtime-deps-2.1 with the following result:

zphbf3v

From what I can find, libicu55 has been removed from 18.04 and moved to libicu60

dbegg35 avatar Oct 18 '18 17:10 dbegg35

@bartonjs @wfurt can you help here please? We test Ubuntu 18.04 in our CI, so there should be a way to make it happen ...

karelz avatar Oct 18 '18 19:10 karelz

I manually downloaded libicu60 from this url https://packages.ubuntu.com/bionic/amd64/libicu60/download

Installed it with dpkg -i libicu60_60etcetc.deb then ran sudo apt install dotnet-sdk-2.1 and it worked.

armand1m avatar Oct 28 '18 11:10 armand1m

@JerryBian , can you please try installing dotnet-runtime-deps-2.1 and dotnet-runtime-2.1 package separately and share the log here? that worked for me, thanks

SYNTAXDZ avatar Nov 02 '18 10:11 SYNTAXDZ

thanbks @SYNTAXDZ , follow your suggestion, it said that

dotnet-runtime-deps-2.1 : Depends: libicu55 but it is not installable

after that, I installed libicu55, sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main" sudo apt-get update sudo apt-get install libicu55

and then install net core sudo apt-get install dotnet-sdk-2.1

Now, I had dotnet core running on Ubuntu Server 18.04.1

jerryno6 avatar Nov 03 '18 03:11 jerryno6