apt-get 在 Ubuntu VPS 上不起作用

apt-get 在 Ubuntu VPS 上不起作用

我无法在我的 VPS 中使用 apt-get 命令安装任何软件,并且终端打印:

root@ubuntu:~# apt-get install python3
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3' has no installation candidate

有什么问题?我尝试以 root 用户身份执行 apt-get update,结果显示如下:

root@ubuntu:~# apt-get update
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/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: Some index files failed to download. They have been ignored, or old ones used instead.
root@ubuntu:~#

我的 VPS 位于德国。这有关系吗?

答案1

您必须修复 DNS 解析器配置,例如您自己的服务器用于将主机名转换为 IP 地址的 DNS 服务器。这不会影响在您的 VPS 上运行的网站。请勿更改您的域正在使用的 DNS 服务器 - 这会破坏您的网站。

您可以使用提供商的 DNS 服务器(向他们询问设置,或查看他们的文档),或者例如Google 的公共 DNS 解析器

有关如何更改 DNS 服务器的说明,请查看askubuntu.com 上的这个问题

相关内容