当我尝试卸载时出现此错误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
首先注释以odbcinst
和db_purge
开头的两行remove
。- 卸载
msodbcsql17
与sudo apt-get remove msodbcsql17
- 安装
odbcinst
与sudo apt-get install odbcinst
- 重新运行删除后脚本
sudo /var/lib/dpkg/info/msodbcsql17.postrm remove
- 删除
odbcinst
与sudo apt-get remove odbcinst