个人工具

UbuntuHelp:UpgradeProblems

来自Ubuntu中文

Wikibot讨论 | 贡献2007年12月4日 (二) 11:31的版本

跳转至: 导航, 搜索

UpgradeNotes/UpgradeProblems

About this page

This article is a stub! This page tries to collect and describe possible upgrade problems and solutions. Network issues, unreachable hosts, local conditions and other possible problems preventing the Ubuntu distribution upgrade procedure will be addressed. Please help expanding this documentation if you find more information, solutions or workarounds for upgrading Ubuntu. This page will not deal with application bugs. If the issue is related to bugs in the package manager, upgrade manager or other software, please Report the Problem. Be aware that some of the informations here are quite technical. If you're unsure about something, please don't hesitate to ask for help on the forums instead of accidentally breaking your Ubuntu installation!

Cannot connect to host: Fetching updates fails

Affected versions (reported):

  • Ubuntu Gutsy 7.10

Symptoms:

  • Upgrade-Manager hangs during the "Fetching updates" step.
  • sudo do-release-upgrade suddenly stops while trying to connect to a repository.

Cause: The repository from which you are trying to download upgrades from is unreachable.
When upgrading to a new distribution release, the update manager will try to download and add the address of a local download mirror in /etc/apt/sources.list.d/prerequists-sources.list. Sometimes this procedure may fail and add an invalid address, or the mirror might be unreachable due to network issues between you and the host.
Correcting the before mentioned file will not help, as it will just be re-created at next upgrade attempt. Example: Helge lives in Denmark, but due to local network issues the Danish software mirror dk.archive.ubuntu.com does not work as opposed to the global mirror, archive.ubuntu.com, which works fine. Workaround: As a temporary solution, you can force Ubuntu to make requests for the bad host be directed to the good one, e.g. from dk.archive.ubuntu.com to archive.ubuntu.com. This will be based on the IP address of the good host.

1) Obtain the IP address of the good host (in this example we use archive.ubuntu.com): Open a terminal console and run this command:

nslookup archive.ubuntu.com

Output (example):

Name:   archive.ubuntu.com
Address: 91.189.88.46
Name:   archive.ubuntu.com
Address: 91.189.88.31
Name:   archive.ubuntu.com
Address: 91.189.88.45

You can use either of the three IP addresses in the example. 2) Add an entry in /etc/hosts Open /etc/hosts in a text-editor (you'll need root privileges).
At the top of the file, add a new line with the IP of the good host followed by the URL address of the bad host, example:

91.189.88.46 dk.archive.ubuntu.com

This tells Ubuntu that dk.archive.ubuntu.com have the IP that really belongs to archive.ubuntu.com, thus faking connections for dk.archive.ubuntu.com to instead go to archive.ubuntu.com.