upgrade debian 9 to 10

Simple way to upgrade debian OS from 9 to 10

first work with backups or snapshots , if you system is a VPS you can create a snapshot , otherwise create an immage of you system , I suggest clonezilla .

before start , be sure to have a “sysrescue” distro ready , because some problems can be find on bootloader , simple how to here

i use apt instead of apt-get , just for lazy being but is the same .

$ sudo apt update
$ sudo apt upgrade
$ sudo apt full-upgrade
$ sudo apt --purge autoremove

after these commands your Debian will be upgrade to the latest release and cleaned from all deprecated packages and configurations .

let’s run a reboot to be sure that the new kernel – if has been a new kernel – will be loaded for further steps .

$ sudo shutdown -r now

now let’s put hands on the apt source list  , you have already done a backup/snapshot of your system so is useless create a backup of apt directory , anyway if you dare

$ sudo cp -rp /etc/apt /etc/apt-9

now let’s replace the old release in the apt configuration with a simple sed script

$ sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list
$ sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/*

now the distro progression can start

$ sudo apt update ; apt upgrade

now the process requires some interactions to proceede , the upgrade get new versions of programs so new configuration options and so on , is importat that you know what you do if your system is deeply personalized  .

I suggest not to change the configuration simply selecting in the dialog box , at the second panel called “Modified configuration file”:

Keep local version currently installed

when the first run has finished , we are ready to allign all installed packages to the new release , sometimes you can have programs with now satisfied dependencies , no warry simply install manualy the dependecy you miss , simply copy & paste what apt return out .

Now you can go further with full-upgrade

$ sudo apt full-upgrade

interact with questions about configs , there will be other interactions so pay attention , in my humle opinion , is safe to confirm always “no” as configured in the past steps .

After finished this last step , reboot your system , 99% on 100% something will go wrong about grub , this what happend me 3 times on 3 , so be ready with the mentioned rescue CD to reinstall the bootloader .

finish

do you have probem that the boot stuck on grub_rescue ? here a solution

Torna in alto