Upgrade Debian Sarge to Debian Etch

Before upgrading your system, it is strongly recommended that you make a full backup, or at least back up any data or configuration information you can’t afford to lose. The upgrade tools and process are quite reliable, but a hardware failure in the middle of an upgrade could result in a severely damaged system

The main things you’ll want to back up are the contents of /etc, /var/lib/dpkg and the output of dpkg --get-selections “*” (the quotes are important).

The upgrade process itself does not modify anything in the /home directory. However, some applications (e.g. parts of the Mozilla suite, and the GNOME and KDE desktop environments) are known to overwrite existing user settings with new defaults when a new version of the application is first started by a user. As a precaution, you may want to make a backup of the hidden files and directories (“dotfiles”) in users’ home directories. This backup may help to restore or recreate the old settings. You may also want to inform users about this.

Any package installation operation must be run with superuser privileges, so either login as root or use su or sudo to gain the necessary access rights.

Unofficial sources and backports

If you have any non-Debian packages on your system, you should be aware that these may be removed during the upgrade because of conflicting dependencies. If these packages were installed by adding an extra package archive in your /etc/apt/sources.list, you should check if that archive also offers packages compiled for etch and change the source line accordingly at the same time as your source lines for Debian packages.

Adding APT sources

The default configuration is set up for installation from main Debian Internet servers, but you may wish to modify /etc/apt/sources.list to use other mirrors, preferably a mirror that is network-wise closest to you.

For example, suppose your closest Debian mirror is http://mirrors.kernel.org/debian/. When inspecting that mirror with a web browser or FTP program, you will notice that the main directories are organized like this:


To use this mirror with apt, you add this line to your sources.list file

deb http://mirrors.kernel.org/debian etch main contrib

Note that the `dists’ is added implicitly, and the arguments after the release name are used to expand the path into multiple directories.

After adding your new sources, disable the previously existing “deb” lines in sources.list by placing a hash sign (#) in front of them.

Upgrading packages

The recommended way to upgrade from previous Debian GNU/Linux releases is to use the package management tool aptitude. This program makes safer decisions about package installations than running apt-get directly.

Next you should double-check that the APT source entries (in /etc/apt/sources.list) refer either to “etch” or to “stable”. There should not be any sources entries pointing to sarge. Note: source lines for a CD-ROM will often refer to “unstable”; although this may be confusing, you should not change it.

Once you’ve updated your sources.list in /etc/apt you can upgrade from Sarge to Etch by running:

# apt-get update

# apt-get install aptitude

# aptitude -f --with-recommends dist-upgrade

Sponsored Link

6 thoughts on “Upgrade Debian Sarge to Debian Etch

  1. Burning Question:
    Should we dist-upgrade to etch while still using the 2.6.8 kernel from sarge, or after changing the sources.list to “etch” we should first install the 2.6.18 kernel?

    Or immediately after dist-upgrade upgrade the kernel to 2.6.18?

    What is the safer way to do it?

  2. Azar: see the release notes about the safest way to upgrade.

    Admin: 1. using “stable” instead of “etch” in sources.list saves you from having to change sources.list with each new release.
    2. Why do recommend using –with-recommends? I think with or without recommends is a personal preference that does not make the upgrade better or worse.
    3. The release notes recommends that the upgrade is done in several steps, not a simple aptitude -f dist-upgrade.

  3. Why are you recommending using “–with-recommends” ? That has the potential to pull in a HUGE amount of unnecessary packages rather than just upgrading the ones that are installed.

  4. Hi,

    I’m getting the following error when i try to update&&upgrade with aptitute

    Preconfiguring packages ...
    Can't exec "/tmp/linux-image-2.6.18-6-686-bigmem.config.273351": Permission denied at /usr/share/perl/5.8/IPC/Open3.pm line 168.
    open2: exec of /tmp/linux-image-2.6.18-6-686-bigmem.config.273351 configure failed at /usr/share/perl5/Debconf/ConfModule.pm line 58
    linux-image-2.6.18-6-686-bigmem failed to preconfigure, with exit status 9
    Can't exec "/tmp/linux-image-2.6.18-4-686-bigmem.config.273353": Permission denied at /usr/share/perl/5.8/IPC/Open3.pm line 168.
    open2: exec of /tmp/linux-image-2.6.18-4-686-bigmem.config.273353 configure 2.6.18.dfsg.1-12~bpo.2 failed at /usr/share/perl5/Debconf/ConfModule.pm line 58
    linux-image-2.6.18-4-686-bigmem failed to preconfigure, with exit status 9
    (Reading database ... 52305 files and directories currently installed.)
    Unpacking linux-image-2.6.18-6-686-bigmem (from .../linux-image-2.6.18-6-686-bigmem_2.6.18.dfsg.1-23_i386.deb) ...
    dpkg: error processing /var/cache/apt/archives/linux-image-2.6.18-6-686-bigmem_2.6.18.dfsg.1-23_i386.deb (--unpack):
    failed in buffer_write(fd) (9, ret=-1): backend dpkg-deb during `./lib/modules/2.6.18-6-686-bigmem/kernel/fs/ntfs/ntfs.ko': No space left on device
    dpkg-deb: subprocess paste killed by signal (Broken pipe)
    Preparing to replace linux-image-2.6.18-4-686-bigmem 2.6.18.dfsg.1-12~bpo.2 (using .../linux-image-2.6.18-4-686-bigmem_2.6.18.dfsg.1-12etch2_i386.deb) ...
    The directory /lib/modules/2.6.18-4-686-bigmem still exists. Continuing as directed.
    Unpacking replacement linux-image-2.6.18-4-686-bigmem ...
    dpkg: error processing /var/cache/apt/archives/linux-image-2.6.18-4-686-bigmem_2.6.18.dfsg.1-12etch2_i386.deb (--unpack):
    failed in buffer_write(fd) (9, ret=-1): backend dpkg-deb during `./lib/modules/2.6.18-4-686-bigmem/kernel/fs/ocfs2/dlm/ocfs2_dlm.ko': No space left on device
    dpkg-deb: subprocess paste killed by signal (Broken pipe)
    Errors were encountered while processing:
    E: Sub-process /usr/bin/dpkg returned an error code (1)

Leave a comment

Your email address will not be published. Required fields are marked *