How to upgrade Debian 9 to Debian 10
To upgrade Debian 9 to Debian 10, first make sure your system is uptodate.
1 |
apt update && apt upgrade -y |
Edit file /etc/apt/sources.list. Find all occurance of “stretch” and replace it with “buster”.
1 |
sed -i 's/stretch/buster/g' /etc/apt/sources.list |
Or use following
1 2 3 4 5 |
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
1 |
apt update && apt upgrade -y |
run dist-upgrade
1 |
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 newer version. If your server have these files modified, you should be careful as replacing these files will lose the changes you made.
Reboot the server.
1 |
reboot |
After reboot, you can verify server is running Debian 10 with commands
1 2 |
lsb_release -a hostnamectl |