问题描述:
W: Failed to fetch http://mirrors.aliyun.com/debian/dists/wheezy/InRelease Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch http://mirrors.aliyun.com/debian/dists/wheezy-updates/InRelease Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch http://mirrors.aliyun.com/debian-security/dists/wheezy/updates/InRelease Temporary failure resolving 'mirrors.aliyun.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
修改
/etc/resolv.conf
追加
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 198.153.192.1
nameserver 198.153.194.1
nameserver 208.67.222.222
nameserver 208.67.220.220
重启网络
sudo /etc/init.d/networking restart
但是下次开机以后/etc/resolv.conf 文件恢复初始值, sudo apt-get update 还是会出问题,找到解决办法:sudo vim /etc/network/interfaces
添加:
dns-nameserver 8.8.8.8
dns-nameserver 8.8.4.4
dns-nameserver 198.153.192.1
dns-nameserver 198.153.194.1
dns-nameserver 208.67.222.222
dns-nameserver 208.67.220.220
重启虚拟机
sudo apt-get update 可以一直用了