How to upgrade Debian 9 Stretch to Debian 10 Buster

BACK UP YOUR DATA!

I can't stress enough. Back up your data! See DebianUpgrade

Prep the vm

If you have VM running Debian 9 with WebConsole, clone it first before we upgrade to Debian 10 on the cloned VM.

vm is a custom script based on virsh, virt-install, virt-clone etc.

$ vm shutdown d09
$ vm clone d09
$ vm start d09-clone
$ ssh d09-clone

Prep the Upgrade

If you see some error during the initial sudo apt update, just run sudo apt autoclean

$ sudo vi /etc/apt/sources.list
(replace 'stretch' to 'buster')

$ sudo apt update
...
The AppStream system cache was updated, but some errors were detected, which might lead to missing metadata. 
Refer to the verbose log for more information.
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 
'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'
E: Sub-process returned an error code

$ sudo apt autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done

$ sudo apt update
...
Reading package lists... Done
Building dependency tree
Reading state information... Done
1305 packages can be upgraded. Run 'apt list --upgradable' to see them.

Upgrade

It's time for full-upgrade

  • it may ask you a few questions during the upgrade
  • In most case, answer no

$ sudo apt full-upgrade
...
(wait for 5 mins)
...
1) apt-listchanges: News --> exit by pressing 'q'
2) MiniSSDP daemon configuration -->  Start the MiniSSDP daemon automatically?  --> No
3) Configuring libc6:amd64 --> Restart services during package upgrades without asking?  --> No
4) Configuring libpam0g:amd64 --> Services to restart for PAM library upgrade: --> Ok
...
(wait for another 5 mins)
...
Processing...
You have mail in /var/mail/tchung

Reboot and Confirm

It's time to reboot and confirm.

$ sudo reboot
...
$ lsb_release -d
Description:    Debian GNU/Linux 10 (buster)