有次在安装vsftpd的时候,安装使用完后想把软件卸载,先是手工一个个文件去删除,后面发现文件比较多就直接命令:
dpkg -P vsftpd
然后发现不能完全清除了,而且当想下载其他软件的时候如:expat,发生了如下错误:
jacky:/var/lib# apt-get install expat
Reading package lists... DoneBuilding dependency tree
Reading state information... Done
The following packages will be REMOVED:
vsftpd
The following packages will be upgraded:
expat
1 upgraded, 0 newly installed, 1 to remove and 412 not upgraded.
1 not fully installed or removed.
Need to get 0 B/25.5 kB of archives.
After this operation, 286 kB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 199738 files and directories currently installed.)
Removing vsftpd ...
dpkg: error processing vsftpd (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
vsftpd
試了很多的办法去解决,也遇到比较坑的解决办法,如下:
進到 /var/lib/dpkg/info 目錄
將卡住的套件檔案刪掉即可
apt-get autoclean
apt-get autoremove
apt-get update
apt-get upgrade
网上很多论坛都说不要轻易使用apt-get autoclean 和 apt-get autoremove 因为字两个命令会删除很多信赖包不存在了的软件,即很多你还是需要的软件也会在不知情中被删除,以后再下载更新恢复可能就不一定是当初的环境和版本了,所以,慎用!!!
其实针对字种问题,只需要一条简单的命令就好了,错误提示是该软件包现在的状态极为不妥 - 建议您在卸载它之前再重新安装一次。在处理时有错误发生:vsftpd,所以运行如下命令:
apt-get install --reinstall vsftpd
另外还有一种方法是从/var/cache/apt/archives/目录下把下载的deb找到, 再运行命令:
dpkg -i firefox-mozilla-buildxxxx.deb
这样就可以了