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上

相關內容