Thursday, November 11, 2021

[SOLVED] Package conflict while installing ms-sql in ubuntu. Broken packages

Issue

I am trying to install ms sql in Ubuntu 20.04. Even I have got it installed in 20.04 successfully following this guide but I sometime I have this problem multiple time and not sure why is this happening.

When I try to run following commads

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

sudo apt-get install mssql-tools unixodbc-dev

I end up having below errors:

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 2.3.6-0.1build1 is to be inst

E: Unable to correct problems, you have held broken packages.

sudo apt-cache policy <package> shows multiple versions available for these packages. I tried installing the right versions for dependencies that did not help when I ran sudo apt-get install mssql-tools unixodbc-dev again.

When I checked msprod.list file, it looks like 'https://packages.microsoft.com/config/ubuntu/18.04/prod' the tailed .list is missing so I added that(not sure I should do that or not). Then I have got everything installed.

Now when I do sudo apt update it ends up with below error:

E: The repository 'https://packages.microsoft.com/ubuntu/18.04/prod.list bionic Release' does not have a Release file.

N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.

I really don't understand what is happening and what I have to do to get thing working in simplest way.


Solution

Do as follow:

apt install mssql-tools unixodbc-dev odbcinst1debian2 msodbcsql17 unixodbc libodbc1

apt-get install stuff caring about package conflict.

If you use apt only it will forcefully install the package without taking care if the installation is creating conflicts.



Answered By - Francesco Mantovani