Wait, not that Bullseye!

Upgrading Raspberry Pi OS From Buster to Bullseye

Linux Dec 3, 2021

It's easy, really. You can search for a tutorial yourself and you'll find plenty, but don't do what I did and follow the top result on Google search; the dude that wrote the top result you'll most likely find did a silly thing with updating the kernel as well as completely omitted a step. So let me show you the way I ended up doing it which as far as I'm aware is the correct method. And no I'm not putting the $ at the start of each command like so many nobs do. I find that trend utterly pointless and somewhat condescending.

First, update your package lists:

sudo apt update

Just to be on the safe side, now upgrade all your packages so they're the latest versions for Buster:

sudo apt full-upgrade

And yes, full-upgrade is just as good as dist-upgrade.

Now you want to do a little editing:

sudo nano /etc/apt/sources.list

In that file you want change buster to bullseye (there are two instances, one's found on a commented out line but you may as well change that too in case you ever need to uncomment it and use it but forget to alter it):

Buster to Bullseye

Once you're done, press CTRL+X to exit, press Y to confirm saving the modifications then press Enter to save the same filename.

Now for the bit the numpty omitted; you also want to edit this file and do the same again:

sudo nano /etc/apt/sources.list.d/raspi.list

It'll look much the same as the previous file, so as I say, do the same as above.

Once you have saved the file, you want to update your packages and then run an upgrade again, though this time it'll probably want to sort out several hundred packages, but this is normal:

sudo apt update

sudo apt full-upgrade

You may be given various things to read as it goes. I prefer to read through the shit or at least skim it just in case something important crops up.

Also at this point if you need new kernels, the latest stable versions will be installed with this process. The idiot who wrote the other article seemingly thought you had to do it manually using a special command, but it's unnecessary and even advisable that you don't, as while you may get the very latest versions of the kernels doing it that way, they won't necessarily be stable.

Anyway, once all this is done you can do a bit of spring cleaning if you so desire:

sudo apt autoremove

sudo apt clean

And lastly you should reboot:

sudo reboot

That is largely it. However you may find your network interface names have gone done fucked up now. This may result in the Pi ignoring what you've got setup in the dhcpcd.conf file if you have a static IP set or similar settings that were bound to a specific interface, which in turn will probably mean it loses Internet connectivity. I had this issue as the Pi I was doing this upgrade on was a Pihole, a server that had a static IP. After the upgrade it started giving itself a default IP considerably different to the one I had set and wasn't connecting to the default gateway.

It turned out this was because the Ethernet interface had gone from being named simply eth0to a longer more complicated string that included the interface MAC address. As such the settings I'd put in dhcpcd.conf were ignored (as they were for the eth0 interface which no longer existed). Even turning predictable network interface names on in the configuration tool didn't work but there is a fix that requires you edit the command line file:

sudo nano /boot/cmdline.txt

Scroll right to the end of the line (don't start a new line), add a space after bootwait (or whatever is at the end of the line for you) and enter the following:

net.ifnames=0

Save and exit as above; CTRL+X then Y then ENTER. Now reboot again with sudo reboot. Hopefully your interface names have returned to what they were before (i.e. easy to distinguish) and Internets should work again. Of course if you had your Pi running mostly on default settings to begin with and it was getting an IP dynamically from a DHCP server on your network, this step may be irrelevant to you.

One other thing I noticed was autologin decided to turn itself off after I upgraded. That may or may not have been a fluke but it can easily be fixed by using the configuration tool to turn it back on again. Though similarly to the interface names, if you don't have it automatically login anyway it'll be a non-issue for you.

Tags