How to upgrade Debian Linux system from Wheezy to Jessie stable release

This article describes an upgrade procedure from Debian Wheezy to Debian Jessie. Debian Linux with a code name “Jessie” is the latest stable Debian release which succeeds previous stable version “Wheezy”.

It is important to point out that nothing is bulletproof and proper failover procedure should be discussed before the upgrade takes place. The rule of thumb is, the less software is installed on your system the higher chance for a successful upgrade. Before you move on with the upgrade consider the following recommendations.

Relevant article:

Upgrade Recommendations

  • Remove unnecessary packages
  • Fully upgrade your current system
  • Make a data backup
  • Although there should not be a problem to perform update via SSH. If possible it is recommended to perform upgrade directly using console

Fully Upgrade current System

First, fully upgrade your current Wheezy Debian system:

# apt-get update
# apt-get upgrade
# apt-get dist-upgrade



Upgrade to Debian Jessie

Once the above upgrade is finished update /etc/apt/sources.list:

# sed -i 's/wheezy/jessie/g' /etc/apt/sources.list

For example:

FROM DEBIAN WHEEZY:
# cat /etc/apt/sources.list
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

deb http://ftp.at.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.at.debian.org/debian/ wheezy main contrib non-free
TO DEBIAN JESSIE
deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

deb http://ftp.at.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.at.debian.org/debian/ jessie main contrib non-free

At this stage we are ready to upgrade packages:

# apt-get update
# apt-get upgrade

During the upgrade you may be given an option to manually or automatically restart any currently running services. The recommended strategy is to do manual restart as it provides more flexibility. If you are running SSH service you will be also given an option to disable SSH root access. What it means, that if you opt to “YES” you will no longer be able to SSH login as root user.

If there are no issues with the package upgrade we are ready to perform a full system distribution upgrade from Debian Wheezy to Debian Jessie.

# apt-get dist-upgrade

After the upgrade it is recommended to reboot your system:

# reboot

Check your upgrade:

root@debian:~# hostnamectl 
   Static hostname: debian
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 909d78b4d6cd403bb9cf478d1a3fb18d
           Boot ID: 17584ebda9d447cc9657fcbced3850d0
    Virtualization: oracle
  Operating System: Debian GNU/Linux 8 (jessie)
            Kernel: Linux 3.16.0-4-amd64
      Architecture: x86-64