將 Ubuntu 16.04 更新到 18.04 後,我遇到了「apt update」錯誤

將 Ubuntu 16.04 更新到 18.04 後,我遇到了「apt update」錯誤

這些是錯誤訊息:

Err:1 https://esm.ubuntu.com/infra/ubuntu xenial-infra-security InRelease
  Could not resolve host: esm.ubuntu.com
Err:2 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial InRelease
  Temporary failure resolving 'ppa.launchpad.net'
Err:3 http://ppa.launchpad.net/ubuntu-desktop/ubuntu-make/ubuntu xenial InRelease
  Temporary failure resolving 'ppa.launchpad.net'
Err:4 https://esm.ubuntu.com/infra/ubuntu xenial-infra-updates InRelease
  Could not resolve host: esm.ubuntu.com
Reading package lists... Done
W: Failed to fetch http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'ppa.launchpad.net'
W: Failed to fetch http://ppa.launchpad.net/ubuntu-desktop/ubuntu-make/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'ppa.launchpad.net'
W: Failed to fetch https://esm.ubuntu.com/infra/ubuntu/dists/xenial-infra-security/InRelease  Could not resolve host: esm.ubuntu.com
W: Failed to fetch https://esm.ubuntu.com/infra/ubuntu/dists/xenial-infra-updates/InRelease  Could not resolve host: esm.ubuntu.com
W: Some index files failed to download. They have been ignored, or old ones used instead.

答案1

步驟1。檢查您的網路連線。如果不好就切換到本地鏡像。另請檢查您的裝置是否已正確設定以連接到網路。

第2步。刪除所有 PPA 並嘗試sudo apt update && sudo apt full-upgrade

步驟3.嘗試手動更改xenialbionicin/etc/apt/sources.list和所有文件etc/apt/sources.d,然後sudo apt update.我之前沒有嘗試過,因為這是“debian 方式”,但它應該可以工作。不過作為預防措施,您應該備份文件。

相關內容