Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable install SQLserver tool in ubuntu 20

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.

like image 558
Peter Avatar asked Jun 15 '20 11:06

Peter


2 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
like image 71
Jiří Chmiel Avatar answered Oct 17 '22 00:10

Jiří Chmiel


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)

like image 28
The Splund Avatar answered Oct 16 '22 23:10

The Splund