Ubuntu安装程序出现“Sub-process /usr/bin/dpkg returned an error code (1)"的问题
解决方法**:
sudo可要可不要,自行选择。
1.$ sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old
//现将info文件夹更名
2.$ sudo mkdir /var/lib/dpkg/info
//再新建一个新的info文件夹
3.$ sudo apt-get update && apt-get -f install
//不用解释了吧
4.$ sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old
//执行完上一步操作后会在新的info文件夹下生成一些文件,现将这些文件全部移到info_old文件夹下
5.$ sudo rm -rf /var/lib/dpkg/info
//把自己新建的info文件夹删掉
6.$ sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info
//把以前的info文件夹重新改
root@xuxin-virtual-machine:/home/xuxin# sudo apt-get install lsb-core正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
lsb-core 已经是最新版 (9.20160110ubuntu0.2)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 394 个软件包未被升级。
有 1 个软件包没有被完全安装或卸载。
解压缩后会消耗 0 B 的额外空间。
您希望继续执行吗? [Y/n] y
正在设置 lsb-core (9.20160110ubuntu0.2) ...
File "/usr/bin/py3compile", line 4
SyntaxError: Non-ASCII character '\xc2' in file /usr/bin/py3compile on line 4, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
dpkg: 处理软件包 lsb-core (--configure)时出错:
子进程 已安装 post-installation 脚本 返回错误状态 1
在处理时有错误发生:
lsb-core
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@xuxin-virtual-machine:/home/xuxin# sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old
root@xuxin-virtual-machine:/home/xuxin# sudo mkdir /var/lib/dpkg/info
root@xuxin-virtual-machine:/home/xuxin# sudo apt-get update && apt-get -f install
命中:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial InRelease
命中:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-updates InRelease
命中:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-backports InRelease
命中:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-security InRelease
正在读取软件包列表... 完成
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 394 个软件包未被升级。
有 1 个软件包没有被完全安装或卸载。
解压缩后会消耗 0 B 的额外空间。
正在设置 lsb-core (9.20160110ubuntu0.2) ...
root@xuxin-virtual-machine:/home/xuxin# sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old
root@xuxin-virtual-machine:/home/xuxin# sudo rm -rf /var/lib/dpkg/info
root@xuxin-virtual-machine:/home/xuxin# sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info
root@xuxin-virtual-machine:/home/xuxin# sudo apt-get install lsb-core正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
lsb-core 已经是最新版 (9.20160110ubuntu0.2)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 394 个软件包未被升级。
root@xuxin-virtual-machine:/home/xuxin#