Klaus Zimmermann's Corner

Updating to Debian 11 Bullseye

Though I have not daily-drived Debian GNU/Linux for a couple of years (stopped around the Jessie-Stretch area), a recent proposition of interest (the Old Computer Challenge) revived my interest in it again, where I picked it back up on the Buster release, version 10.3. Little did I know at the time, though, that there was another big release coming up just around the corner.

Debian 11, codenamed Bullseye, was released a few weeks ago at this time of writing, on August 14th 2021. This was a great piece of news, as this OS not only is signature-stable and has a huge load of software ported to it, but also is the rock-solid base on which a myriad of other OSes base themselves on. With this update, the kernel 5.10 line finally makes its debut on Debian and lots of other big updates arrived as well. And with this announcement just after I did the challenge, I got to thinking: hey, it's time to update!

It should be noted that most releases of distributions come with release bugs that even the most extensive of tests can't completely iron out, and usually I wouldn't do this update is such a short period after the first release. My game plan usually involves waiting out a few more weeks, perhaps a month and a half before I feel the release has matured enough - which also gives me time to catch up on backups before I jump it. Why did I do it so early this time? Because the machine I'm using is mostly a throwaway one, having been sourced - quite literally - from the trash and housing almost no data in it. If it broke, big deal!

So perhaps you might wanna consider taking a little more time before updating your box if it contains important data or has a lot of services and specific software installed in it. But here's how it went for me anyway:

Preparations

This is the step before the update where you back up all your data and config files before jumping in the water, but for the reasons pointed above, I mostly skipped them. Here's what I would have done, though.

First and foremost, back up not only your user data (which you should already have backed up regularly, right?) but also your configuration files, both at dotfile level inside $HOME and for each service run by your machine, like your web server, database server, Tor relay, etc. Sometimes their config files change per large update, and you should keep a backup to restore them if they get overwritten.

Afterwards, that's where the magic starts to happen in the actual update. There are really only three basic steps to updating a Debian machine to a newer release:

  1. Point sources.list to a the new release.
  2. Update apt and install new packages.
  3. Reboot.

Sounds easy enough? That's because it is. But let's delve a little deeper into the process' steps next:

Update sources.list

The Debian team makes a huge effort (and by huge, I really mean huge) in building the new packages for the new release, and they are stored isolated from the previous releases so that dependency mismatch doesn't happen when installing things via the package manager. When you want to change the release, you have to explicitly tell apt to use the new package sources, which is done by configuring the file /etc/apt/sources.list.

The format and default syntax for Bullseye have changed slightly from previous releases of Debian, which is hinted by its release notes in the Debian wiki. Essentially, you should change the lines for main, updates and security to the following:

deb http://deb.debian.org/debian bullseye main
deb http://security.debian.org/debian-security bullseye-security main
deb http://deb.debian.org/debian bullseye-updates main

Note that the security line changed slightly since other releases. Since I enabled the other repositories, and had to install nonfree wifi drivers, I also added the following lines in my file:

deb http://deb.debian.org/debian/ bullseye contrib non-free
deb-src http://deb.debian.org/debian/ bullseye contrib non-free

Save and close the file, now you're ready to perform surgery!

Updating and installing new packages

To make sure everything gets updated correctly and that nothing breaks mid-update, I started to adopt a "strict mode" preparation before any large update of a distribution, which I first talked about in my upgrading to FreeBSD 13 article. I borrowed this method from the Siduction distribution, where they recommend doing this every time you run a major update, and has served me well.

First, close all your running programs, log out of the graphical session and log into the virtual console (TTY) with Ctrl+Alt+F1. Log in as root and drop to text-only mode with:

# init 3

This will kill any running X session, which could break the system if running through an update, but will keep networking and etc running. Only then, issue the update command:

# apt-get update
# apt-get dist-upgrade

apt will offer to upgrade all packages to the new distribution's ones. This is a sizeable download (mine being about 1.6GiB), and might take considerable time depending on your connection. As the files are unpacked and begin to be installed, pay attention to the changelogs (displayed once before any packages begin to be installed) and the configuration file changes (aren't you glad you backed them up before?). Since I had a rather simple barebones system here, I gladly accepted everything as per the new maintainers' versions and everything finished nice and easy. Once apt finishes its job, it's time to go ahead and reboot into your new system!

Solve remaining issues after the reboot

Congratulations, you're now running Debian Bullseye. Now comes the fun part: now that all the old and perfectly working packages are flushed, and you're in your shiny new system, it's time to resolve any outstanding bugs that remain after upgrade! Wait, did I really say "fun?" Perhaps there's a better word for it.

Though the installation went spotless, the only issue that I found with Bullseye post reboot was with the network. Though nothing happened to the drivers I previously installed on it, it seems that Bullseye decided to abandon the previous wicd package that was used in Buster to manage the Wifi connections. As a result, I found myself with no internet, and there wasn't even wpa_supplicant to manage the connection manually like in a trick I previously used in FreeBSD. Oh fie, guess that's what you should read changelogs for!

Hook up the ethernet cable, put the interface up and I'm ready to install some sort of connection manager for myself. My go-to solution was network-manager which has both graphical (applet-like) and a CLI interface, named nm-tui. I think it's also the default from Bullseye and on? Regardless, from there on, it was just a matter of detecting my network, authenticating and I'm back again!

Mind you, however, that this was a very simple update on a machine that didn't have many services running. Had this been a busy server with many different services running, the story could've been much more complicated.

Conclusion: excellence and ease of use wrapped into one

Screenshot of my Debian Bullseye Desktop
My final desktop after the update to Debian Bullseye from Buster. Makes me want to install it on more machines!

Like always, Debian Bullseye offers a great experience to the user and no cost of usability, power or security. Perhaps not as fun as building my system from zero with a distribution like Arch or Alpine Linux, but it's very robust and you can get to speed without lagging behind on system configuration. On the server, it maintains the tradition of stability and reliability offered by the Stable line of Debian.

Props to everyone working with the Debian Project for this great release! Perhaps it's time for me to start contributing and giving back to the community, after enjoying Debian for so long. I just wonder where and how.

Have you installed or updated to Debian Bullseye already? How easy or hard was that? Did you find any bugs? Let me know on Mastodon!


This post is number #26 of my #100DaysToOffload project. Follow my progress through Mastodon!


Last updated on 08/28/21