How to upgrade Debian 9 to Debian 10
To upgrade Debian 9 to Debian 10, first make sure your system is up-to-date.
apt update && apt upgrade -y
Edit file /etc/apt/sources.list. Find all occurrences of “stretch” and replace it with “buster”.
sed -i 's/stretch/buster/g' /etc/apt/sources.list
Or use following
deb http://cloudfront.debian.net/debian/ buster main non-free contrib
deb-src http://cloudfront.debian.net/debian/ buster main non-free contrib
deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main contrib non-free
Now update the system
apt update && apt upgrade -y
run dist-upgrade
apt dist-upgrade -y
During the upgrade, you will be asked to replace some of the configuration files. If this is a fresh server, you can always replace these files with a newer version. If your server has these files modified, you should be careful as replacing these files will lose the changes you made.
![Debian 10 upgrade](https://serverok.in/wp-content/uploads/2019/06/debian-10-upgrade-replace-files.png)
Reboot the server.
reboot
After reboot, you can verify the server is running Debian 10 with commands
lsb_release -a
hostnamectl
![Debian 10](https://serverok.in/wp-content/uploads/2019/06/debian-10-lsb_release.png)