6
votes

After sucessfully installing Sql Server Following the docs, Failed to install SQL Server command-line tools on Ubuntu 20.04. Efforts led to below commands and results:

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

OK

curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list

deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main

sudo apt-get update 

Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Hit:3 http://x.archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://x.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:5 http://x.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:6 ... packages . microsoft . com/ubuntu/18.04/mssql-server-2019 bionic InRelease
Hit:7 ... packages . microsoft . com/ubuntu/20.04/prod focal InRelease
Hit:8 ... download . gocd . org InRelease
Hit:9 ... packages . microsoft . com/ubuntu/18.04/prod bionic InRelease Get:10 ... security . ubuntu . com/ubuntu focal-security/main amd64 DEP-11 Metadata [21.3 kB]
Get:11 ... security . ubuntu . com/ubuntu focal-security/universe amd64 DEP-11 Metadata [31.5 kB]
Fetched 160 kB in 17s (9,288 B/s)
Reading package lists... Done

sudo apt-get install mssql-tools unixodbc-dev

Reading package lists... Done Building dependency tree
Reading state information... Done mssql-tools is already the newest version (17.5.2.1-1). 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: mssql-tools : Depends: msodbcsql17 (>= 17.3.0.0) but it is not going to be installed unixodbc-dev : Depends: unixodbc (= 2.3.7) Depends: odbcinst1debian2 (= 2.3.7) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

I tried following the dependency failure tree to install unmet dependencies manually but in the final step failed to install:

sudo apt-get install multiarch-support

Reading package lists... Done Building dependency tree
Reading state information... Done Package multiarch-support 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 'multiarch-support' has no installation candidate

How would you solve these issues to finally install the Command line?

1
If you're using Ubuntu 20.04, why are you trying to install the 18.04 packages?Larnu
yep! seems the docs are outdated :))user13747357
20.04 isn't officially supported yet, so not outdated, simply relevant to what's supported.Larnu
Ok, btw thank you.user13747357
Still not "supported". Idk why MS wants to waste our time. If I want to install postgresql it's 1 command and I'm done.Cyril

1 Answers

10
votes

Using:

curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list

Instead of:

curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list

Solves the issue, The docs are out dated or maybe Ubuntu 20.04 is not officially supported yet...

Also I wasn't able to use curl https://... (Don't know why always peer closed my connection!) so I manually downloaded the link and paste the result to /etc/apt/sources.list.d/msprod.list