ubuntu 16.04 apt-get update 报错解决

一:Some index files failed to download, they have been ignored, or old ones used instead.

更换国内源,修改/etc/apt/sources.list 文件的源地址

可删除掉sources.list 文件内容或备份

1.1 cp sources.list sources.list.bak

1.2 粘贴以下内容

阿里源
deb http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free

1.3 执行 apt-get update 完成源切换

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

2.1 mv /var/lib/dpkg/info /var/lib/dpkg/info.bak
2.2 mkdir /var/lib/dpkg/info
2.3 apt-get update

猜你喜欢

转载自www.cnblogs.com/sojrs/p/10896921.html