今天使用sudo apt-get update命令时出现fetch failed xxxx错误,百度得知是由于dns服务器地址和阿里源地址需要更换(百度一大堆,没有几个可以用的)。
下面提供一下本人刚刚解决的问题的方法。
dns服务器地址,修改/etc/resolv.conf文件内容:
nameserver 119.29.29.29
nameserver 114.114.114.114
nameserver 180.76.76.76
nameserver 1.2.4.8
nameserver 127.0.0.53
阿里云源地址,修改/etc/apt/sources.list文件内容:
deb http://mirrors.aliyun.com/ubuntu/ artful main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ artful-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ artful-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ artful-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ artful main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ artful-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ artful-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ artful-backports main restricted universe multiverse
如此即可运行sudo apt-get update进行更新