个人工具

UbuntuHelp:EOLUpgrades

来自Ubuntu中文

Wikibot讨论 | 贡献2009年5月18日 (一) 15:42的版本 (创建新页面为 '{{From|https://help.ubuntu.com/community/EOLUpgrades}} {{Languages|UbuntuHelp:EOLUpgrades}} == Introduction == This upgrade guide will explain how to upgrade an EOL release of U...')

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索

Introduction

This upgrade guide will explain how to upgrade an EOL release of Ubuntu to another EOL release of Ubuntu and then get to a supported system. This is meant for systems which cannot install a newer version of update-manager as described in bug 264181 (for link see the See also section). If you want to know what EOL means, have a look overhere: [1] This upgrade exercise has been executed on a fresh install of Ubuntu 6.10 and we will upgrade to 8.04.2 LTS. All the repositories which are on a default installation are enabled, this is the sources.list file which we used to start the upgrade process, all comments have been removed to make it a shorter list.

deb http://nl.archive.ubuntu.com/ubuntu/ edgy main restricted
deb-src http://nl.archive.ubuntu.com/ubuntu/ edgy main restricted

deb http://nl.archive.ubuntu.com/ubuntu/ edgy-updates main restricted
deb-src http://nl.archive.ubuntu.com/ubuntu/ edgy-updates main restricted

deb http://nl.archive.ubuntu.com/ubuntu/ edgy universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ edgy universe

deb http://nl.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu edgy-security main restricted
deb-src http://security.ubuntu.com/ubuntu edgy-security main restricted
deb http://security.ubuntu.com/ubuntu edgy-security universe
deb-src http://security.ubuntu.com/ubuntu edgy-security universe

This guides assumes that the user knows his way on the terminal, as no graphical tools are used.

6.10 to 7.04

  • Change all the archive.ubuntu.com (or your countries mirror) URL to old-releases.ubuntu.com
sudo perl -p -i.ORIG -e 's/(?:(?:\w+.)?archive|security).(ubuntu.com)/old-releases.$1/' /etc/apt/sources.list
  • Update the package list
sudo aptitude update
  • Install update manager
sudo aptitude install update-manager-core update-manager
  • Upgrade all current packages
sudo aptitude upgrade
  • Upgrade your complete system

You need to run do-release-upgrade once, it will fail, but that doesn't matter. We will trigger the upgrade process from a different executable once we ran do-release-upgrade.

sudo do-release-upgrade

You will now see the following messages on your screen, directly after executing the command:

wesleys@ubuntu-eol-upgrade:~$ sudo do-release-upgrade
Checking for a new ubuntu release
Done Upgrade tool signature
Done Upgrade tool
Done downloading
extracting '/tmp/tmpH9WhkH/feisty.tar.gz'
authenticate '/tmp/tmpH9WhkH/feisty.tar.gz' against '/tmp/tmpH9WhkH/feisty.tar.gz.gpg'

And many more error messages, you can ignore them for now. Remember the directory as seen in the sniplet above. The upgrade process changes old-releases.ubuntu.com links to archive.ubuntu.com, because we upgrade to another EOL release the archive link will not work. To prevent this from happening we are going to patch the upgrade controler script. Contents of the patch file:

--- DistUpgradeControler.py.ORIG        2009-01-29 18:51:43.000000000 +0100
+++ DistUpgradeControler.py     2009-01-29 18:52:44.000000000 +0100
@@ -352,11 +352,11 @@
             # them back to archive.ubuntu.com - now this is a problem
             # of course for people upgrading from EOL release to a
             # EOL release
-            if (not entry.disabled and
-                entry.uri.startswith("http://old-releases.ubuntu.com/ubuntu")):
-                entry.uri = "http://archive.ubuntu.com/ubuntu"
-                logging.debug("transitioning old-releases.ubuntu.com to '%s' " % entry)
-                continue
+            #if (not entry.disabled and
+            #    entry.uri.startswith("http://old-releases.ubuntu.com/ubuntu")):
+            #    entry.uri = "http://archive.ubuntu.com/ubuntu"
+            #    logging.debug("transitioning old-releases.ubuntu.com to '%s' " % entry)
+            #    continue

             logging.debug("examining: '%s'" % entry)
             # check if it's a mirror (or offical site)
  • Apply the patch:
cd /tmp/tmpH9WhkH/
sudo patch < DistUpgradeControler.py.patch
# or if you have the patch file in your homedir
sudo patch < $HOME/DistUpgradeControler.py.patch

NOTE: If you do not have patch installed run the command below, or make these changes manually. You will need root privileges to edit the file (as you can see from the sudo patch line).

sudo aptitude install patch

When you have applied the patch execute the following command:

sudo ./feisty --frontend DistUpgradeViewText --mode=server

Now reboot your machine. When your machine comes back up again you are running feisty. You can check this by running

lsb_release -a

7.04 to 7.10

This upgrade did not go as smooth as I expected. I expected the upgrade process to be similar to 6.10 -> 7.04 like in bug 264181, but that was not the case.

  • Run do-release-upgrade
sudo do-release-upgrade

It will fail, because it does not rewrite old-releases.ubuntu.com to archive.ubuntu.com as expected. But we need to run it once, to get some files from the feisty repo's. Make sure you remember that /tmp directory again, we are going to need it in a sec. If you did not record the location we can find it pretty easy:

find /tmp -name gutsy

This will tell you where the upgrade script resides and you just need to enter that directory.

  • Change your sources.list

We now need to change our sources.list to have only gutsy (7.10) repositories, you may wish to use a different mirror (archive then becomes in my case nl.archive).

sudo perl -p -i.feisty -e 's/old-releases.ubuntu.com/archive.ubuntu.com/g' /etc/apt/sources.list

If you have the security repositories make sure you change them to security.ubuntu.com, eg

deb http://archive.ubuntu.com/ubuntu feisty-security main restricted
# Changes to
deb http://security.ubuntu.com/ubuntu feisty-security main restricted

Once this is done we are going to change feisty to gutsy:

sudo perl -p -i -e 's/feisty/gutsy/g' /etc/apt/sources.list

Some users have mailed me that there are some extra steps to complete the upgrade. We need to edit the prerequists-sources.list in the /tmp directory to make sure the release-upgrader-dpkg and release-upgrader-apt packages can be installed.

cd /tmp/tmpeBHg_m

perl -p -i.feisty -e 's/(http:\/\/).*archive(.ubuntu.com)/${1}old-releases$2/' prerequists-sources.list 

Or make the changes manually:

deb http://${countrymirror}archive.ubuntu.com/ubuntu feisty-backports main/debian-installer

to

deb http://old-releases.ubuntu.com/ubuntu feisty-backports main/debian-installer

  • Continue the upgrade process
cd /tmp/tmpeBHg_m
sudo ./gutsy --frontend DistUpgradeViewText --mode=server

Now reboot your machine. When your machine comes back up again you are running gutsy. You can check this by running

lsb_release -a

7.10 to 8.04.2

Please have a look at the following documentation: https://help.ubuntu.com/community/HardyUpgrades But in short:

sudo do-release-upgrade

Reboot and you are good to go.

See Also

Upgrade path:

Bugs:

Comments

If you think something is incorrect on this page please contact me. My contact details can be found on launchpad: https://launchpad.net/~wesleys