打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Ubuntu “Failed to fetch”错误的解决方法

操作系统Ubuntu 12.04 LTS

Ubuntu操作系统中,使用apt-get命令安装所需的开发软件非常方便,但也有不少时候由于链接不上软件源而不能正常安装,于是很多人都会想到使用sudo apt-get update命令来更新软件源,而恰恰这时屋漏偏逢连夜雨,更新命令也不能正常工作,出现大量“Failed to fetch”的错误。   

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/main/binary-i386/Packages  Something wicked happened resolving 'archive.ubuntu.com:http' (-5 - No address associated with hostname)W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/restricted/binary-i386/Packages  Something wicked happened resolving 'archive.ubuntu.com:http' (-5 - No address associated with hostname)W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/universe/binary-i386/Packages  Something wicked happened resolving 'archive.ubuntu.com:http' (-5 - No address associated with hostname)W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/multiverse/binary-i386/Packages  Something wicked happened resolving 'archive.ubuntu.com:http' (-5 - No address associated with hostname)W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-updates/main/i18n/Translation-en_US  Something wicked happened resolving 'archive.ubuntu.com:http' (-5 - No address associated with hostname)

其实,解决这个问题十分简单,只要设置妥当DNS服务器即可.
$ sudo vim /etc/resolv.conf 
修改DNS:

nameserver 8.8.8.8

nameserver 8.8.4.4

然后重启网络服务:sudo etc/init.d/networking restart

再次执行sudo apt-get update命令,结果一切正常。

我按照这个改了之后发现依然不行,后来点击链接进入该链接的上一级目录,发现是该目录下没有所请求的资源,而不是网络的问题。

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
apt-get update更新源时,出现“Hash Sum mismatch”问题
移除Ubuntu上陈旧的PPA仓库
UBUNTU-14.04 – 在 X 显示器上闲置几秒钟后隐藏鼠标
ubuntu12.04软件更新有关问题
Ubuntu 10.04 DVD作为升级的源(国内的升级源)
Ubuntu10.10软件源,163更新源
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服