我正在尝试按照以下说明在 Ubuntu 20.04 中安装 Microsoft ODBC Driver 17这里。
然而,当我输入
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17
我收到以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
msodbcsql17 is already the newest version (17.10.2.1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up msodbcsql17 (17.10.2.1-1) ...
odbcinst: symbol lookup error: odbcinst: undefined symbol: iniOpen
dpkg: error processing package msodbcsql17 (--configure):
installed msodbcsql17 package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
msodbcsql17
E: Sub-process /usr/bin/dpkg returned an error code (1)
odbcinst
似乎已正确安装:
odbcinst -j
unixODBC 2.3.11
DRIVERS............: /usr/local/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources
USER DATA SOURCES..: /home/atorres/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
我尝试过清除并重新安装unixodbc
,odbcinst
但没有成功。我也没有成功sudo dpkg --configure -a
。有人知道我的系统可能出了什么问题吗?
答案1
如果我没记错的话,你忘记了安装的一部分。odbcinst -i
将显示相同的错误(因此它与 apt 无关,而是与安装后的设置的执行有关)。
您需要以下一项或多项:
sudo apt install odbcinst libsqliteodbc, msodbcsql17, odbc-postgresql, tdsodbc mysql-connector-odbc
如果需要重置 odbcinst,请在再次安装之前删除
/usr/bin/odbcinst
/etc/odbcinst.ini
/usr/share/man/man1/odbcinst.1.gz