您的位置:首页 > 其它

apt-get: Could not resolve 'archive.ubuntu.com'

2015-03-05 22:48 591 查看
最近在搭建 Vagrant 服务器的时候, 使用
sudo apt-get update
的时候出现了访问错误

Err http://archive.ubuntu.com trusty InRelease

Err http://archive.ubuntu.com trusty-updates InRelease

Err http://security.ubuntu.com trusty-security InRelease

Err http://archive.ubuntu.com trusty Release.gpg
Could not resolve 'archive.ubuntu.com'
Err http://security.ubuntu.com trusty-security Release.gpg
Could not resolve 'security.ubuntu.com'
Err http://archive.ubuntu.com trusty-updates Release.gpg
Could not resolve 'archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease[/code] 
使用
ping www.baidu.com
发现可以返回数据, 但是
ping archive.Ubuntu.com
则没有反应, host 机器是有访问返回的.

修正方法是:

step 1: 修改host
/etc/hosts


添加如下映射

91.189.91.93    archive.ubuntu.com
91.189.91.93    security.ubuntu.com


step 2: 重启network服务

$ /etc/init.d/networking restart
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  apt-get ubuntu vagrant
相关文章推荐