从 WSL1 中的 Ubuntu 20.04 中删除 mssql-server

从 WSL1 中的 Ubuntu 20.04 中删除 mssql-server

我在以 WSL1 运行的 Ubuntu 20.04 上安装了 mssql-server。然而,这是一个错误的举动,因为它无法正确安装它。更糟糕的是,我也无法删除它。所以我的 apt 卡在了 mssql-server 上,我既不能正确安装,也不能完全删除它。

当我尝试删除它时,它会显示如下错误

root@my-host:/var/cache/apt# apt remove mssql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libc++1 libc++1-10 libc++abi1-10 libsss-nss-idmap0
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  mssql-server
0 upgraded, 0 newly installed, 1 to remove and 139 not upgraded.
1 not fully installed or removed.
After this operation, 1195 MB disk space will be freed.
Do you want to continue? [Y/n]
dpkg: error processing package mssql-server (--remove):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
dpkg: too many errors, stopping
Errors were encountered while processing:
 mssql-server
Processing was halted because there were too many errors.

任何帮助,将不胜感激。

答案1

sudo mv /var/lib/dpkg/info/mssql-server.* /tmp/然后这样做sudo dpkg --remove --force-remove-reinstreq mssql-server

相关内容