2

I just installed MSSQL 2017 for linux and Visual Studio code for linux on my Ubuntu 18.10 machine. Both the installation succeeded, but I cannot connect from visual studio to the DB.

I have the following running drivers:

$ odbcinst -j

    unixODBC 2.3.7
    DRIVERS............: /etc/odbcinst.ini
    SYSTEM DATA SOURCES: /etc/odbc.ini
    FILE DATA SOURCES..: /etc/ODBCDataSources
    USER DATA SOURCES..: /home/neo4j/.odbc.ini
    SQLULEN Size.......: 8
    SQLLEN Size........: 8
    SQLSETPOSIROW Size.: 8

but, when I try to install

$ sudo apt-get install mssql-tools unixodbc-dev

I receive the following error:

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:
 mssql-tools : Depends: msodbcsql17 (>= 17.3.0.0) but it is not going to be installed
               Depends: msodbcsql17 (< 17.4.0.0) but it is not going to be installed
 unixodbc-dev : Depends: unixodbc (= 2.3.7)
E: Unable to correct problems, you have held broken packages.

after a lot of googling, i found a lot of suggestions, but they doesn't run, like try to remove msodbcsql and unixodbc

$ sudo apt-get remove msodbcsql

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'msodbcsql' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

At this point I'm locked and not able to go ahead.

Has anyone some running solution?

3

Try executing the following command:

sudo apt-get install libodbc1 unixodbc msodbcsql mssql-tools unixodbc-dev

OR

In order to force "apt-get install" to answer "Yes" to any "Are you sure you want to install this package? [Y/n]" questions which may arise do:

sudo apt-get install libodbc1 unixodbc msodbcsql mssql-tools unixodbc-dev -y

Remember to leave feedback if that helps.

2
  • Thanks . You saved my day ! Worked like a charm on Ubuntu 17.10 artful . – Alexander Glulkhovtsev Apr 9 '19 at 14:50
  • @AlexanderGlulkhovtsev you're welcome... I'm glad it helped you out! – ThunderBird Apr 9 '19 at 18:21
2

I had this issue too.

It transpired msodbcsql depended on unixodbc (as you have noted), which depended on libodbc1. I had to install these first.

sudo apt-get install libodbc1 
sudo apt-get install unixodbc
sudo apt-get install msodbcsql

# You can now install the package you actually want

sudo apt-get install mssql-tools unixodbc-dev

Hope that helps.

0

You may have to install libcurl3 as well. I got this error and I solved it by using this command:

sudo apt-get install libcurl3 -y

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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