Linux: Debian release upgrade

From Luky-Wiki
Revision as of 22:16, 21 June 2017 by Lukas Dzunko (talk | contribs) (Created page with "This article describe update from Debian 8 (Jessie) to Debian 9 (Stretch). It may be used also for future updates but keep in mind that references to "Stretch" needs to be upd...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This article describe update from Debian 8 (Jessie) to Debian 9 (Stretch). It may be used also for future updates but keep in mind that references to "Stretch" needs to be updated for such a use case. Also take extra precaution if you use third party software. Additional compatibility checks and update steps may be necessary if third party software is installed on system.

Here is step by step procedure:

1. Take system backup and offload it

Update itself should be flawless but ...

  • new packages mean new version of configuration and data structures (database files). Relevant files are converted during update so everything will work fine. In case you will need (or like) to rollback update then backup will be essential for this.
  • update itself is highly tested by Debian developers but it may be case that your configuration is somehow special and update fail. It is just much easier to restore system than try to repair it ...

It is good practice to backup system prior to update and offload backup data from system.

2. Search for obsolete packages

aptitude search '~o'

This command list all packages that are no longer present in repository. Those packages are either obsolete or manually installed. Consider removing all those packages before continuing.

3. Perform full Jessie Upgrade

It is essential to get system up2date on Jessie before we move to Stretch.

apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get autoremove
apt-get clean

4. Check package database

This step will performs database sanity and consistency check.

dpkg --audit
apt-mark showhold

If there are packages On Hold then un-hold them and upgrade before continuing. If you skip this check then you may face problems with dependencies in next steps.

5. Modify repository configuration

Open /etc/apt/sources.list for editing and replace references to jessie with stretch.

File should looks like this:

deb http://ftp.sk.debian.org/debian/ stretch main
deb-src http://ftp.sk.debian.org/debian/ stretch main

deb http://security.debian.org/ stretch/updates main
deb-src http://security.debian.org/ stretch/updates main

# stretch-updates, previously known as 'volatile'
deb http://ftp.sk.debian.org/debian/ stretch-updates main
deb-src http://ftp.sk.debian.org/debian/ stretch-updates main


6. Upgrade to Stretch

apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get autoremove
apt-get clean

7. Verify package database

dpkg --audit
aptitude search '~o'

8. Reboot system

This step is necessary to load new kernel and also good practice to see if system boot in case reboot is needed.

shutdon -r now

Final verification of debian version:

lsb_release -a