Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

Unable install SQLserver tool in ubuntu 20

Writer Andrew Henderson

I installed SQLserver in my ubuntu. But when I install sqlserver-tool something happened. type

sudo apt-get install unixodbc-dev

return

eading 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: unixodbc-dev : Depends: unixodbc (= 2.3.7) Depends: odbcinst1debian2 (= 2.3.7) but 2.3.6-0.1build1 is to be installed
E: Unable to correct problems, you have held broken packages.

so that I tried below

sudo apt-get install unixodbc

returns

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: unixodbc : Depends: odbcinst1debian2 (>= 2.3.7) but 2.3.6-0.1build1 is to be installed Depends: libodbc1 (>= 2.3.7) but 2.3.6-0.1build1 is to be installed
E: Unable to correct problems, you have held broken packages.

and lastly

sudo apt-get install odbcinst1debian2

return

eading 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: odbcinst1debian2 : PreDepends: multiarch-support but it is not installable
E: Unable to correct problems, you have held broken packages.

I completely stacked and have no idea at all. Dose anybody can help for me. Thanks.

1

4 Answers

User rim96 has right, the reason is that Microsoft's source list includes unixodbc in higer version (2.3.7) that depends on multi-arch (unlike Ubuntu's version 2.3.6) I think that unixodbc 2.3.6 is good enough. In my case the follow steps helped me.

Remove Microsoft's source list.

mv /etc/apt/sources.list.d/mssql-tools.list ~/

Update sources

sudo apt-get update 

Install unixodbc 2.3.6 from Ubuntu repository

sudo apt-get install unixodbc

Move Microsoft's source list back

mv ~/mssql-tools.list /etc/apt/sources.list.d/

Update sources again

sudo apt-get update

Install mssq-tools (or whatever you want) from Microsoft's repository

sudo apt-get install mssql-tools
3

User Jiří Chmiel's answer helped a lot, though I changed two lines to:

 sudo mv /etc/apt/sources.list.d/msprod.list ~/

and:

 sudo mv ~/msprod.list /etc/apt/sources.list.d/

was what worked for me (Ubuntu 20.04 in Dec '20)

This problems looks like you forgot to run sudo apt-get update before installing odbcinst1debian2. On focal this package does not depend on multiarch-support.

From

3

If you follow Microsoft install guide for SQL Server Tools, for Ubuntu it says

If you are using Ubuntu 18.04 or Ubuntu 20.04, change the repository path in step 2 below from /ubuntu/16.04 to /ubuntu/18.04 or /ubuntu/20.04

So in step 2, you should do

curl | sudo tee /etc/apt/sources.list.d/msprod.list

instead of

curl | sudo tee /etc/apt/sources.list.d/msprod.list
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.