Whenever I try to apt-get install mssql-tools, I get,

Preconfiguring packages ...
(Reading database ... 302749 files and directories currently installed.)
Preparing to unpack .../msodbcsql17_17.0.1.1-1_amd64.deb ...
Installation failed, ODBC Driver 17 for SQL Server detected!
dpkg: error processing archive /var/cache/apt/archives/msodbcsql17_17.0.1.1-1_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Selecting previously unselected package mssql-tools.
Preparing to unpack .../mssql-tools_17.0.1.1-1_amd64.deb ...
Unpacking mssql-tools ( ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried removing /usr/lib/libmsodbcsql-17.so and also removing odbcinst.ini,

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

1 Answer 1


From ServerFault,

sudo dpkg -P msodbcsql
sudo apt -f install

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.