解决Ubuntu 12.04更新错误:( – 5 – 没有与主机名关联的地址)
问题描述:
每次我尝试下载操作系统的更新(Ubuntu 12.04)时,我都会收到以下错误消息列表:
W:Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/Release.gpg Something wicked happened resolving 'extras.ubuntu.com:http' (-5 - No address associated with hostname) , W:Failed to fetch http://ppa.launchpad.net/deluge-team/ppa/ubuntu/dists/precise/Release.gpg Something wicked happened resolving 'ppa.launchpad.net:http' (-5 - No address associated with hostname) , W:Failed to fetch http://packages.medibuntu.org/dists/precise/Release.gpg Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname) , W:Failed to fetch http://archive.canonical.com/ubuntu/dists/precise/Release.gpg Something wicked happened resolving 'archive.canonical.com:http' (-5 - No address associated with hostname) , W:Failed to fetch http://ppa.launchpad.net/tualatrix/ppa/ubuntu/dists/precise/Release.gpg Something wicked happened resolving 'ppa.launchpad.net:http' (-5 - No address associated with hostname) , E:Some index files failed to download. They have been ignored, or old ones used instead.
(/etc/apt/sources.list)文件的内容:
# deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release i386 (20120423)]/ precise main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://archive.ubuntu.com/ubuntu precise main restricted deb-src http://archive.ubuntu.com/ubuntu precise main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://archive.ubuntu.com/ubuntu precise-updates main restricted deb-src http://archive.ubuntu.com/ubuntu precise-updates main restricted ## NB software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://archive.ubuntu.com/ubuntu precise universe deb-src http://archive.ubuntu.com/ubuntu precise universe deb http://archive.ubuntu.com/ubuntu precise-updates universe deb-src http://archive.ubuntu.com/ubuntu precise-updates universe ## NB software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://archive.ubuntu.com/ubuntu precise multiverse deb-src http://archive.ubuntu.com/ubuntu precise multiverse deb http://archive.ubuntu.com/ubuntu precise-updates multiverse deb-src http://archive.ubuntu.com/ubuntu precise-updates multiverse ## NB software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://archive.ubuntu.com/ubuntu precise-security main restricted deb-src http://archive.ubuntu.com/ubuntu precise-security main restricted deb http://archive.ubuntu.com/ubuntu precise-security universe deb-src http://archive.ubuntu.com/ubuntu precise-security universe deb http://archive.ubuntu.com/ubuntu precise-security multiverse deb-src http://archive.ubuntu.com/ubuntu precise-security multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. deb http://archive.canonical.com/ubuntu precise partner # deb-src http://archive.canonical.com/ubuntu precise partner ## This software is not part of Ubuntu, but is offered by third-party ## developers who want to ship their latest software. deb http://extras.ubuntu.com/ubuntu precise main # deb-src http://extras.ubuntu.com/ubuntu precise main
(/etc/apt/sources.list.d)目录中的文件:
-rw-r--r-- 1 root root 136 Oct 10 16:30 deluge-team-ppa-precise.list -rw-r--r-- 1 root root 136 Oct 10 16:30 deluge-team-ppa-precise.list.save -rw-r--r-- 1 root root 285 Oct 10 16:30 medibuntu.list -rw-r--r-- 1 root root 285 Oct 10 16:30 medibuntu.list.save -rw-r--r-- 1 root root 132 Oct 10 16:30 tualatrix-ppa-precise.list -rw-r--r-- 1 root root 134 Oct 10 16:30 tualatrix-ppa-precise.list.save -rw-r--r-- 1 root root 148 Oct 10 16:30 yannubuntu-boot-repair-precise.list -rw-r--r-- 1 root root 148 Oct 10 16:30 yannubuntu-boot-repair-precise.list.save
AskUbuntu.com上此post的相关链接:
服务器错误(-5 – 没有与主机名关联的地址)
更新时如何修复“-5没有与主机名错误相关的地址”?
我试图在线研究解决问题的方法,但我没有弄清楚我得到这些错误的真正原因。 任何可能有助于我解决这个问题的建议,想法或解决方案都非常感谢。
该问题的解决方案如下:
第1步:进入系统 – >首选项 – >网络连接。
步骤2:接下来,选择默认网络接口(eth0)并单击“编辑”。
步骤3:然后选择“IPv4设置”并选择“仅限自动(DHCP)地址”。
步骤4:接下来,在“DNS服务器”框中输入新的DNS服务器地址。 使用逗号分隔多个地址,然后单击“应用”进行保存。
第5步:选择您首选的DNS详细信息
OpenDNS ---> 208.67.222.222, 208.67.220.220 Google Public DNS ---> 8.8.8.8, 8.8.4.4 Comodo Secure DNS ---> 156.154.70.22, 156.154.71.22
配置完成后,检查以确保它正常运行。
有关解决类似问题的完整分步教程,请检查:
http://www.liberiangeek.net/2010/08/change-dns-information-ubuntu-10-04-lucid-lynx/
以上链接说明了如何更改Ubuntu中的DNS设置。
我有同样的问题,上述答案都没有解决。 我现在已经修好了。 事实certificate我需要做的就是进入终端并键入sudo apt-get update
。 运行完毕后,我的更新管理器刷新了,给了我一个要更新的项目的新列表,然后我点击了更新,一切运行正常。 不知道这是否会对其他人有所帮助,但我希望如此。
cat /etc/apt/sources.list
编辑
sudo gedit /etc/apt/sources.list
删除http://packages.medibuntu.org/
然后运行
sudo apt-get update
如果您只收到与packages.medibuntu.org
相关的错误,那么该存储库已根据启动板上的官方repo页面和这些 讨论 主题关闭。
症状:
W: Failed to fetch http://packages.medibuntu.org/dists/precise/Release.gpg Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname) W: Failed to fetch http://packages.medibuntu.org/dists/precise/free/source/Sources Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname) W: Failed to fetch http://packages.medibuntu.org/dists/precise/non-free/source/Sources Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname) W: Failed to fetch http://packages.medibuntu.org/dists/precise/free/binary-amd64/Packages Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname) W: Failed to fetch http://packages.medibuntu.org/dists/precise/non-free/binary-amd64/Packages Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname) W: Failed to fetch http://packages.medibuntu.org/dists/precise/free/binary-i386/Packages Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname) W: Failed to fetch http://packages.medibuntu.org/dists/precise/non-free/binary-i386/Packages Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname) W: Failed to fetch http://packages.medibuntu.org/dists/precise/free/i18n/Translation-en_US Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname) W: Failed to fetch http://packages.medibuntu.org/dists/precise/free/i18n/Translation-en Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname) W: Failed to fetch http://packages.medibuntu.org/dists/precise/non-free/i18n/Translation-en_US Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname) W: Failed to fetch http://packages.medibuntu.org/dists/precise/non-free/i18n/Translation-en Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname) E: Some index files failed to download. They have been ignored, or old ones used instead.
解:
命令行方法
- 从
/etc/apt/sources.list.d
目录中删除medibuntu repo:sudo rm /etc/apt/sources.list.d/medibuntu.list*
- 运行
sudo apt-get update
- (可选)如果在此之后仍然看到错误,请运行
grep -lir medibuntu /etc/apt/sources.list.d/ | xargs sudo rm
grep -lir medibuntu /etc/apt/sources.list.d/ | xargs sudo rm
,然后再次尝试运行第2步 。
GUI方法
- 打开Synaptic Package Manager (按
Super
/Winkey
然后键入Synaptic Package Manager
并单击显示名为Synaptic Package Manager
的第一个应用程序结果) - 在应用程序的菜单中,选择
Settings
– >Repositories
- 选择
Other Software
选项卡,然后向下滚动并取消选中或删除packages.medibuntu.org
所有条目(参见屏幕截图) - 单击
Close
- 单击Synaptic Package Manager中的“
Reload
按钮(在后台运行apt-get update
)
如果您有代理,那么此链接有一些答案。
查看设置apt-get以在网页中使用http-proxy部分。