我刚刚在我的 Ubuntu 18.10 机器上安装了适用于 linux 的 MSSQL 2017 和适用于 linux 的 Visual Studio 代码。两个安装都成功了,但我无法从 Visual Studio 连接到数据库。
我有以下正在运行的驱动程序:
$ 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
但是,当我尝试安装
$ sudo apt-get install mssql-tools unixodbc-dev
我收到以下错误:
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.
经过大量谷歌搜索,我发现了很多建议,但它们没有运行,比如尝试删除 msodbcsql 和 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.
在这一点上,我被锁定,无法继续。
有没有人正在运行的解决方案?
尝试执行以下命令:
或者
为了迫使“
apt-get install
”回答“Yes
”可能出现的任何“Are you sure you want to install this package? [Y/n]
”问题,请执行以下操作:如果有帮助,请记住留下反馈。
我也有这个问题。
它发生了 msodbcsql 依赖于 unixodbc (正如你所指出的),它依赖于 libodbc1。我必须先安装这些。
希望有帮助。
您可能还需要安装
libcurl3
。我得到了这个错误,我通过使用这个命令解决了它: