为什么apt-get无法解析镜像?

可能重复:
apt-get update无法获取文件,“临时故障解决…”错误

我知道这已经被覆盖过,但我似乎无法解决我的问题。 这是我的输出。

jake@KUBIE-SERVER:~$ sudo apt-get update Err http://us.archive.ubuntu.com precise InRelease Err http://us.archive.ubuntu.com precise-updates InRelease Err http://us.archive.ubuntu.com precise-backports InRelease Err http://security.ubuntu.com precise-security InRelease Err http://archive.canonical.com precise InRelease Err http://ppa.launchpad.net precise InRelease Err http://archive.canonical.com precise Release.gpg Temporary failure resolving 'archive.canonical.com' Err http://ppa.launchpad.net precise Release.gpg Temporary failure resolving 'ppa.launchpad.net' Err http://security.ubuntu.com precise-security Release.gpg Temporary failure resolving 'security.ubuntu.com' Err http://us.archive.ubuntu.com precise Release.gpg Temporary failure resolving 'us.archive.ubuntu.com' Err http://us.archive.ubuntu.com precise-updates Release.gpg Temporary failure resolving 'us.archive.ubuntu.com' Err http://us.archive.ubuntu.com precise-backports Release.gpg Temporary failure resolving 'us.archive.ubuntu.com' Reading package lists... Done W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/InRelease W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise- updates/InRelease W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise- backports/InRelease W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease W: Failed to fetch http://archive.canonical.com/ubuntu/dists/precise/InRelease W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/precise/InRelease W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg Temporary failure resolving 'us.archive.ubuntu.com' W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise- updates/Release.gpg Temporary failure resolving 'us.archive.ubuntu.com' W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise- backports/Release.gpg Temporary failure resolving 'us.archive.ubuntu.com' W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise- security/Release.gpg Temporary failure resolving 'security.ubuntu.com' W: Failed to fetch http://archive.canonical.com/ubuntu/dists/precise/Release.gpg Temporary failure resolving 'archive.canonical.com' W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/precise/Release.gpg Temporary failure resolving 'ppa.launchpad.net' W: Some index files failed to download. They have been ignored, or old ones used instead. 

任何帮助是极大的赞赏。

我有同样的错误。 我最初认为这是/etc/apt/sources.list中的一个错误,但是在ping了不仅是security.ubuntu.com以及google.com ,我发现我的服务器连接到网络但没有到达外面网络。

我编辑了/etc/network/interfaces并将eth0设置为DHCP而不是静态。 然后我让我的路由器负责为服务器提供静态IP。 重启服务器,一切正常。

您可以在此处找到有关IP配置的更多信息。

您没有详细说明可能解释您的问题背后的周围情况。

如果它说,您似乎有一些包管理问题,可能是由于您正在使用的镜像,可能缺少或需要更新您要求的Precise包。

试试这个:

  1. 打开终端并输入:

     sudo nano /etc/apt/sources.list 

    编辑源文件。

  2. 在开始时,添加以下行:

     deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse 

    这应该告诉apt-get根据你的地理位置自动为你挑选一面镜子。

  3. 保存文件并更新您的来源:

     sudo apt-get update 

这假设您没有遇到任何互联网连接或DNS问题。

希望这可以帮助。