apt-get dist-upgrade 在 mssql-tools 和 msodbcsql17 軟體包上失敗,ubuntu 16.04

apt-get dist-upgrade 在 mssql-tools 和 msodbcsql17 軟體包上失敗,ubuntu 16.04

我一如既往地定期升級軟體包,但有些東西壞了,甚至無法清除軟體包,因為依賴關係已損壞。伺服器是 Azure 上的 Ubuntu 16.04。我們在這台伺服器上使用 MySQL,所以這個套件可能只是 Azure 的東西?

輸出如下:

You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: mssql-tools : Depends: msodbcsql17 (>= 17.0.0.1) but it is not installed Depends: msodbcsql17 (< 17.1.0.0) but it is not installed E: Unmet dependencies. Try using -f.

當我執行 apt-get -f install 時,就像在大多數情況下建議的那樣,輸出是:

apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following additional packages will be installed: msodbcsql17 The following NEW packages will be installed: msodbcsql17 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. 6 not fully installed or removed. Need to get 3,760 kB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 https://packages.microsoft.com/ubuntu/16.04/prod xenial/main amd64 msodbcsql17 amd64 17.0.1.1-1 [3,760 kB] Fetched 3,760 kB in 0s (15.1 MB/s) Preconfiguring packages ... (Reading database ... 153677 files and directories currently installed.) Preparing to unpack .../msodbcsql17_17.0.1.1-1_amd64.deb ... Unpacking msodbcsql17 (17.0.1.1-1) ... dpkg: error processing archive /var/cache/apt/archives/msodbcsql17_17.0.1.1-1_amd64.deb (--unpack): trying to overwrite '/usr/lib/libmsodbcsql-17.so', which is also in package msodbcsql 17.0.1.1-1 Errors were encountered while processing: /var/cache/apt/archives/msodbcsql17_17.0.1.1-1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

我已嘗試遵循文件並刪除驅動程式本身,如下所述: https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server

所以我想修復它或完全刪除它並返回 mssql-tools 的 13.1.9.2-1 版本。由於 apt-get 現在有問題,無法在該伺服器上安裝任何東西。

先致謝

答案1

新的 msodbcsql17 軟體包與舊的 msodbcsql 軟體包的 v17 沒有正確衝突。您不能同時安裝兩者。您可以安裝舊的 v13 版本的 msodbcsql。對我來說,我只是想要一個新的,所以我這樣做了:

$ sudo dpkg -P msodbcsql

手動清除衝突的包,這是新的 msodbcsql17 應該做的事情,但事實並非如此。之後你可以運行:

$ sudo apt -f 安裝

並完成所有待處理軟體包的安裝。

微軟在這裡指出了不相容性:

https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server

相關內容