Article

Table of Contents
Theme:
Was this article helpful?

1  out of  1 found this helpful

Try Vultr Today with

$50 Free on Us!

Want to contribute?

You could earn up to $600 by adding new articles.

Upgrade Debian 8 (Jessie) to Debian 9 (Stretch)

Last Updated: Fri, Aug 4, 2017
Debian Linux Guides System Admin
Archived content

This article is outdated and may not work correctly for current operating systems or software.

Introduction

Debian 9 codename Stretch is the latest stable release of Debian, which was released on June 17, 2017. In this tutorial, I am going to show you how to upgrade your Debian 8 (Jessie) server to the latest stable release.

What's New in this Release?

  • Over 15,000 new packages, for a total of over 51,000 packages. Read more.

  • Over 50% of all packages were updated.

  • MariaDB replaces MySQL. Note that binary data file formats are not backwards compatible after upgrading. Read more.

1. Preparation

Debian is an extremely stable operating system and upgrading from one release to another has always been easily performed. To be on the safe side, I strongly recommend that you make a full backup or at least backup any data or configuration information you can't afford to lose. The Vultr snapshot system can be used for easy backup and restore.

This is also a good time to check for broken packages:

sudo dpkg --audit

2. System update

Update the system to the latest version.

apt update

apt upgrade

Once upgraded, you will see the following output.

Reading package lists... Done

Building dependency tree

Reading state information... Done

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

3. Upgrade to Stretch

Make a copy of your original /etc/apt/source.list file.

cp /etc/apt/sources.list /etc/apt/sources.list-jessie

Now edit the file and replace the words jessie with stretch.

deb http://security.debian.org/ stretch/updates main contrib non-free



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



deb http://ftp.uk.debian.org/debian/ stretch-updates main contrib non-free



deb-src http://ftp.uk.debian.org/debian/ stretch-updates main contrib non-free



deb http://ftp.uk.debian.org/debian/ stretch main contrib non-free



deb-src http://ftp.uk.debian.org/debian/ stretch main contrib non-free

Re-run system update and this time run dist-upgrade.

 apt update

 apt upgrade

 apt dist-upgrade

After the upgrade is done, you can remove unnecessary packages.

 apt autoremove

4. Boot into the new system

Reboot the system.

reboot

After the system comes back up, login in and check the Debian version.

cat /etc/debian_version



9.1

... or check the kernel version.

uname -a



Linux mydebian 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux

Conclusion

Upgrading a Debian system in place from Jessie to Stretch is an easy process, but keep in mind that before you decide to do it, you must check any possible third-party applications for compatibility issues.

Want to contribute?

You could earn up to $600 by adding new articles.