我像往常一样定期升级软件包,但有些东西坏了,甚至无法清除软件包,因为依赖关系损坏了。服务器是 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 安装
并完成所有待处理的软件包的安装。
微软在此指出了不兼容性: