I've just took a time to upgrade my Debian 9 Stretch Linux to Debian Buster on my old school Laptop (that turned 11 years old) Lenovo Thinkpad R61 . The upgrade went more or less without severe issues except few things.
The overall procedure followed is described n a few websites out there already and comes up to;
0. Set the proper repository location in /etc/apt/sources.list
Before update the sources.list used are:
deb [arch=amd64,i386] http://ftp.bg.debian.org/debian/ buster main contrib non-free
deb-src [arch=amd64,i386] http://ftp.bg.debian.org/debian/ buster main contrib non-free
deb [arch=amd64,i386] http://security.debian.org/ buster/updates main contrib non-free
deb-src [arch=amd64,i386] http://security.debian.org/ buster/updates main contrib non-free
deb [arch=amd64,i386] http://ftp.bg.debian.org/debian/ buster-updates main contrib non-free
deb-src [arch=amd64,i386] http://ftp.bg.debian.org/debian/ buster-updates main contrib non-free
deb http://ftp.debian.org/debian buster-backports main
For people that had stretch defined in /etc/apt/sources.list you should change them to buster or stable, easiest and quickest way to omit editting with vim / nano etc. is run as root or via sudo:
sed -i 's/stretch/buster/g' /etc/apt/sources.list
sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/*.list
The minimum of config in sources.list after the modification should be
deb http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian buster-updates main
deb http://security.debian.org/debian-security buster/updates main
Or if you want to always be with latest stable packages (which is my practice for notebooks):
deb http://deb.debian.org/debian stable main
deb http://deb.debian.org/debian stable-updates main
deb http://security.debian.org/debian-security stable/updates main
1. Getting list of hold packages if such exist and unholding them, e.g.
Same could also be done via dpkg
dpkg –get-selections | grep hold
To unhold a package if such is found:
echo "package_name install"|sudo dpkg –set-selections
For those who don't know what hold package is this is usually package you want to keep at certain version all the time even though after running apt-get upgrade to get the latest package versions.
2. Use df -h and assure you have at least 5 – 10 GB free space on root directory / before proceed
df -h /
3. Update packages list to set new set repos as default
4. apt upgrade
Here some 10 – 15 times you have to confirm what you want to do with configuration that has changed if you're unsure about the config (and it is not critical service) you're aware as such as Apache / MySQL / SMTP etc. it is best to install the latest maintainer version.
Hopefully here you will not get fatal errors that will interrupt it.
P.S. It is best to run apt-update either in VTTY (Virtual console session) with screen or tmux or via a physical tty (if this is not a remote server) as during the updates your GUI access to the gnome-terminal or konsole / xterm whatever console used might get cut. Thus it is best to do it with command:
screen apt upgrade
5. Run dist-upgrade to finalize the upgrade from Stertch to Buster
Once all is completed of the new installed packages, you will need to finally do, once again it is best to run via screen, if you don't have installed screen install it:
if [ $(which screen) ]; then echo 'Installed'; else apt-get install –yes screen ; fi
screen apt dist-upgrade
Here once again you should set whether old configuration to some e services has to stay or the new Debian maintainer package shipped one will overwrite the old and locally modified (due to some reason), here do wisely whatever you will otherwise some configured services might not boot as expected on next boot.
6. What if you get packages failed on update
If you get a certain package failed to configure after installed due to some reason, if it is a systemd service use:
journalctl -xe |head -n 50
or fully observer output of journalctl -xe and decide on yourself.
In most cases
should do the trick or at least give you more hints on how to solve it.
Also if a package seems to be in inconsistent or broken state after upgrade and simple dpkg-reconfigure doesn't help, a good command
that can help you is
dpkg-reconfigure -f package_name
or you can try to workaround a failed package setup with:
dpkg –configure -a
If dpkg-reconfigure doesn't help either as I experienced in prior of Debian from Debian 6 -> 7 an Debian 7 ->8 updates on some Computers, then a very useful thing to try is:
apt-get update –fix-missing
apt-get install -f
At certain cases the only work around to be able to complete the package upgrade is to to remove the package with apt remove but due to config errors even that is not possible to work around this as final resort run:
dpkg –remove –force-remove-reinstreq
7. Clean up ununeeded packages
Some packages are left over due to package dependencies from Stretch and not needed in buster anymore to remove them.
8. Reboot system once all upgrade is over
9. Verify your just upgraded Debian is in a good state
root@noah:~# uname -a;
Linux noah 4.19.0-5-rt-amd64 #1 SMP PREEMPT RT Debian 4.19.37-5 (2019-06-19) x86_64 GNU/Linux
root@noah:~# cat /etc/issue.net
Debian GNU/Linux 10
root@noah:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Static hostname: noah
Icon name: computer-laptop
Machine ID: 4759d9c2f20265938692146351a07929
Boot ID: 256eb64ffa5e413b8f959f7ef43d919f
Operating System: Debian GNU/Linux 10 (buster)
Kernel: Linux 4.19.0-5-rt-amd64
10. Remove annoying picture short animation with debian logo looping
By default Debian 10 boots up with annoying screen hiding all the status of loaded services state .e.g. you cannot see the services that shows in [ FAILED ] state and which do show as [ OK ] to revert back the old behavior I'm used to for historical reasons and as it shows a lot of good Boot time debugging info, in previous Debian distributions this was possible by setting the right configuration options in /etc/default/grub
which so far in my config was like so
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash scsi_mod.use_blk_mq=y dm_mod.use_blk_mq=y zswap.enabled=1 text"
Note that zswap.enabled=1 passed option is because my notebook is pretty old machine from 2008 with 4GB of memory and zswap does accelerate performance when working with swap – especially helpful on Older PCs for more you can read more about zswap on ArchLinux wiki
After modifying this configuration to load the new config into grub the cmd is:
As this was not working and tried number of reboots finally I found that annoying animated gif like picture shown up is caused by plymouth below is excerpts from Plymouth's manual page:
"The plymouth sends commands to a running plymouthd. This is used during the boot process to control the display of the graphical boot splash."
Plymouth has a set of themes one can set:
# plymouth-set-default-theme -l
I tried to change that theme to make the boot process as text boot as I'm used to historically with cmd:
update-alternatives –config text.plymouth
As after reboot I hoped the PC will start booting in text but this does not happened so the final fix to turn back to textmode service boot was to completely remove plymouth
apt-get remove –yes plymouth