How to Upgrade from Debian 8 Jessie to Debian 9 Stretch
Debian 9 was released on June 17th, 2017, after more than 2 years of development. Debian is a major distro in the Linux community, upon which many other distros like Ubuntu, Linux Mint are based. Debian 9 will be supported for the next 5 years. We will list some notable changes and then show how to upgrade from Debian 8 Jessie to Debian 9 Stretch.
Notable changes in Debian 9
- Firefox replaces Iceweasel as the web browser.
- Thunderbird replaces Icedove as the email client.
- MariaDB replaces MySQL.
- Over 90% of the source packages included in Debian 9 will build bit-for-bit identical binary packages
- X display system no longer requires
root
privileges to run. - The
modern
branch of GnuPG is included in Debian 9 - A new
dbg-sym
repository can be added to the APT source list to provide debug symbols automatically for many packages. - Greatly improved UEFI support, secure boot is still not supported though.
- Numerous updated software packages
- It ships with a bunch of new digital forensics tools like bruteforce-salted-openssl, cewl, dislocker
How to Upgrade from Debian 8 Jessie to Debian 9 Stretch
Unlike Ubuntu, there’s no graphical upgrade manager for Debian. So we will need to upgrade Debian from the command line. Before upgrading, make sure you have your important data backed up. Then follow the instructions below to upgrade your Debian 8 desktop or server.
Login as root on Debian 8.
su -
Then update existing software using the following two commands.
apt update apt upgrade
Next, we need to edit the source list file.
sudo nano /etc/apt/sources.list
Change all instances of “jessie” to “stretch”. If you don’t like changing it one by one, then you can exit out of text editor and run the following command for batch replacement.
sed -i 's/jessie/stretch/g' /etc/apt/sources.list
After that, update software sources and upgrade software to the latest version available in the stretch repository. This step is called minimal upgrade.
apt update apt upgrade
During this step, you will asked if you want to restart services during package upgrades without asking. If you want manually restart services, choose No. This tutorial choose Yes.
Once minimal upgrade is finished, run the following command to begin full upgrade.
apt dist-upgrade
Now you can remove obsolete/unneeded software packages from your Debian system.
apt autoremove apt clean
Finally, reboot the system.
shutdown -r now
Check your Debian version.
lsb_release -a
You should see the following text.
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 9.0 (stretch) Release: 9.0 Codename: stretch
Congrats! You have successfully upgraded Debian 8 Jessie to Debian 9 Stretch.
Thank you for the great upgrade guide.
I hit a strange issue on a few of my servers. When moving from mysql to mariadb, the dist-upgrade will fail if you have slow query log enabled — I assume because of a change in how this option is set in the new version. I had to comment out the following lines on those machines to complete the upgrade.
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 1
to add to my earlier comment:
when moving from 8 to 9, remember to run
sudo mysql_upgrade -u root -p
or you will have strange db issues.