E: Sub-process /usr/bin/dpkg returned an error code (1)错误解决 (转载)

apt-get remove 包名称报如下错误

E: Sub-process /usr/bin/dpkg returned an error code (1)

参考文档如下:

http://www.linuxforums.org/forum/debian-linux-help/133537-subprocess-usr-bin-dpkg-returned-error-code-1-a.html

解决方案:

1. Open terminal, type(打开终端,进入如下目录)

cd /var/lib/dpkg/info

2. Remove the info files for the bad packages (WARNING, this is dangerous in some cases): Type

删除该目录下含有该软件包名称的文件 sudo rm -f <badPackageNameThatWasn'tInstalledInYourCase>*

3.重新APT-GET

sudo apt-get update -f

and

sudo apt-get upgrade, 最后apt install 即可

sudo apt-get install <packageThatCouldn'tBeInstalledPreviously>

网上也有流转修改info的方案,这种方法试过了还是不行

此时可以这样解决:
cd /var/lib/dpkg
sudo mv info info.bak
sudo mkdir info

删除info里面相关文件(处理错误时列出的文件)

sudo dpkg --remove libapache2-mod-php5

猜你喜欢

转载自blog.csdn.net/zgj289563749/article/details/21460241
今日推荐