Upgrade Debian 8 to Debian 9 Stretch

Debian 9 Stretch is almost ready to be released. Release date of Debian 9/Stretch is 2017-06-17.

Today i upgraded a VPS running Debian 8.8/Jessie to Debian 9.

One problem i found was after upgrade, eth0 was renamed to ens3. That is no public network after i reboot the server. I had to login using Virtual Machine Manager and edit /etc/network/interfaces using console. All i had to do was replace all eth0 with ens3.

To find the new interface name, run

ifconfig -a

You may have different name than ens3.

Before you upgrade Debian 8, upgrade it to latest Debian 8 release.

apt-get update
apt-get -y upgrade

Edit /etc/apt/sources.list, replace all occurrence of “jessie” with “stretch”.

sed -i "s/jessie/stretch/g" /etc/apt/sources.list

Now run following commands to update your Debian installation to Debian 9/Stretch

apt-get update 
apt-get clean
apt-get install apt dpkg aptitude -y
apt-get clean
apt-get upgrade -y
apt-get dist-upgrade -y

After upgrade

root@debian:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.0 (stretch)
Release:	9.0
Codename:	stretch
root@debian:~# uname -a
Linux debian.hostonnet.com 4.9.0-3-amd64 #1 SMP Debian 4.9.25-1 (2017-05-02) x86_64 GNU/Linux

IMPORTANT: Before you reboot, make sure your /etc/network/interfaces is set properly, if not server won’t boot properly. Only try this is you can take the risk and want to do the live upgrade.

Posted in Linux