1

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?

Paolo Di Pietro
  • 517
  • 3
  • 17
  • Not sure but I believe that the ODBC/ADO needs to run under wine. – GuidoG Mar 06 '19 at 10:56
  • well, I'm not sure too! All the docs actual docs never talk about Wine or another layer. And everywere it looks like they don't need these layer. I found a specific alert: `Note At this time, the Windows Subsystem for Linux for Windows 10 is not supported as an installation target.`. – Paolo Di Pietro Mar 06 '19 at 15:06

1 Answers1

2

You only need unixodbc-dev if you plan on doing unixodbc-dev development (not required for database connectivity). I'm guessing you can leave it out to avoid confusion here.

And msodbcsql and msodbcsql17 are different packages. msodbcsql (MS ODBC Driver 13 for SQL Server) isn't even available on Ubuntu 18.10.

The key in your problem is the error message:

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

You need to remove the hold on the broken package. First, I'd try specifically installing msodbcsql17:

sudo apt-get install msodbcsql17

If you still get an error, there are other steps you can take to try to fix the problem of held packages: https://askubuntu.com/a/223267