4

I did regular upgrade of packages as always and something broke, cant even purge the packages due broken dependencies. The server is Ubuntu 16.04 on Azure. We are using MySQL on this server, so this package could be just Azure thing?

Output bellow:

You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: mssql-tools : Depends: msodbcsql17 (>= 17.0.0.1) but it is not installed Depends: msodbcsql17 (< 17.1.0.0) but it is not installed E: Unmet dependencies. Try using -f.

And when I do apt-get -f install as it was in most cases advised the output is:

apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following additional packages will be installed: msodbcsql17 The following NEW packages will be installed: msodbcsql17 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. 6 not fully installed or removed. Need to get 3,760 kB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 https://packages.microsoft.com/ubuntu/16.04/prod xenial/main amd64 msodbcsql17 amd64 17.0.1.1-1 [3,760 kB] Fetched 3,760 kB in 0s (15.1 MB/s) Preconfiguring packages ... (Reading database ... 153677 files and directories currently installed.) Preparing to unpack .../msodbcsql17_17.0.1.1-1_amd64.deb ... Unpacking msodbcsql17 (17.0.1.1-1) ... dpkg: error processing archive /var/cache/apt/archives/msodbcsql17_17.0.1.1-1_amd64.deb (--unpack): trying to overwrite '/usr/lib/libmsodbcsql-17.so', which is also in package msodbcsql 17.0.1.1-1 Errors were encountered while processing: /var/cache/apt/archives/msodbcsql17_17.0.1.1-1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

I have tried following the documentation and deleting the driver itself as stated: https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server

So I want either to fix it or completely remove it and return 13.1.9.2-1 version for mssql-tools. Due that apt-get is now bugged and cant install anything on that server.

Thanks in advance

  • Managed with some help to find similar issue, solution in link in case someone else encounters it: https://askubuntu.com/questions/610346/unmet-dependencies-unable-to-fix – Experiance Tranquility Mar 15 '18 at 10:40

1 Answers1

4

The new msodbcsql17 package does not correctly conflict with v17 of the old msodbcsql package. You can't have both installed. You can have the old v13 version of msodbcsql installed. For me, I just wanted the new one so I did:

$ sudo dpkg -P msodbcsql

to purge the conflicting package manually which is what the new msodbcsql17 should be doing, but is not. Afterwards you can run:

$ sudo apt -f install

and complete the install of any pending packages.

Microsoft notes the incompatibility here:

https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server

Tim Riker
  • 51
  • 5
  • Doesn't help. Keeps saying `Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.0.so.1.1' : file not found.` – Artem Novikov Mar 19 '18 at 21:09
  • This file exists on mine after removing the old msodbcsql and installing the new msodbcsql17 $ ls -l /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.0.so.1.1 -rwxr-xr-x 1 root root 16454344 Mar 1 14:02 libmsodbcsql-17.0.so.1.1 – Tim Riker Mar 21 '18 at 00:05
  • Yes, it does exists, but the sqlcmd anyway was throwing this error. I found the soultion here: https://github.com/Microsoft/msphpsql/issues/673 Need to make sure libssl.so.1.0.0 is installed (mind 1.0.0 version). – Artem Novikov Mar 21 '18 at 09:32