Upgrade Raspberry Pi OS from Buster to Bullseye

So to upgrade Raspbian, as it was previously called, from Buster to Bullseye went smooth an easy, I tried this with some Pi2B (armhf 32Bit) and with a Pi4. These two are headless systems, so I don’t know if this works well for any systems with window managers.

Better run these commands in screen, so when the SSH connection is interrupted you can reconnect and resume your work.

Edit: For the update there is a culprit, it will cause a problem with dhcpd, so before the reboot 13. (was point 12. before I added the remark below) please check this post.

Steps to update:

  1. sudo apt update
  2. sudo apt dist-upgrade -y
  3. sudo rpi-update
  4. sudo reboot
  5. sudo apt remove libc6-dev
  6. Edit the file /etc/apt/sources.list, change all occurrences of buster to bullseye.
  7. Edit the file /etc/apt/sources.list.d/raspi.list, change all occurrences of buster to bullseye.
  8. sudo apt update
  9. sudo apt install libgcc-8-dev gcc-8-base
    • Instead of sudo apt install better use my update script, just run ~/up “libgcc-8-dev gcc-8-base” (incl. the “quotation marks”) and skip steps 8., 9., 10. and 11. It doesn’t matter when you already executed step 8..
  10. sudo apt dist-upgrade
  11. sudo apt autoclean
  12. Please edit the file /etc/systemd/system/dhcpcd.service.d/wait.conf, change the path in there from /usr/lib/dhcpcd5/dhcpcd to /usr/sbin/dhcpcd, see here for long version.
  13. sudo reboot

Somewhere along the way there will be a warning that “libc6-dev” can not be upgrade (or so) as it breaks “libgcc-8-dev”, this is the reason for step 5. and 9..

Edit: On the Pi4 I got:

The following packages have unmet dependencies:
 libgcc1 : Depends: gcc-8-base (= 8.3.0-6+rpi1) but 8.4.0-7+rpi1 is to be installed

Which I solved by “sudo apt-get remove libgcc1” and then I just restarted with either point 8. from above, but in my case with “~/up libgcc-8-dev”.

I prefer to update or install packages with this script.

first inspiration from here.