dpkg:删除 msodbcsql17

dpkg:删除 msodbcsql17

当我尝试卸载时出现此错误msodbcsql17

$ sudo dpkg --remove msodbcsql17
(Reading database ... 198868 files and directories currently installed.)
Removing msodbcsql17 (17.9.1.1-1) ...
dpkg: error processing package msodbcsql17 (--remove):
 installed msodbcsql17 package post-removal script subprocess returned error exit status 127
Errors were encountered while processing:
 msodbcsql17

我也尝试过apt remove

sudo apt remove msodbcsql17
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mysql-shell : Depends: libffi7 (>= 3.3~20180313) but it is not going to be installed
               Depends: libpython3.8 (>= 3.8.2) but it is not installable
               Depends: libssl1.1 (>= 1.1.1) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

还:

$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  msodbcsql17 mysql-shell
0 upgraded, 0 newly installed, 2 to remove and 16 not upgraded.
2 not fully installed or removed.
After this operation, 127 MB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 198874 files and directories currently installed.)
Removing msodbcsql17 (17.9.1.1-1) ...
dpkg: error processing package msodbcsql17 (--remove):
 installed msodbcsql17 package post-removal script subprocess returned error exit status 127
dpkg: too many errors, stopping
Errors were encountered while processing:
 msodbcsql17
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

关于如何删除它有什么想法吗?

答案1

我想我也有同样的问题。就我而言,问题是msodbcsql17位于的软件包的删除后脚本/var/lib/dpkg/info/msodbcsql17.postrm正在调用odbcinst- 该脚本未安装在我的系统上。对我有用的是:

  • /var/lib/dpkg/info/msodbcsql17.postrm首先注释以odbcinstdb_purge开头的两行remove
  • 卸载msodbcsql17sudo apt-get remove msodbcsql17
  • 安装odbcinstsudo apt-get install odbcinst
  • 重新运行删除后脚本sudo /var/lib/dpkg/info/msodbcsql17.postrm remove
  • 删除odbcinstsudo apt-get remove odbcinst

相关内容