安裝 Microsoft ODBC 17 驅動程式時發生錯誤

安裝 Microsoft ODBC 17 驅動程式時發生錯誤

我正在嘗試按照以下說明在 Ubuntu 20.04 中安裝 Microsoft ODBC 驅動程式 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

我嘗試清除並重新安裝unixodbcodbcinst但沒有成功。我也沒有運氣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

相關內容