How to Upgrade Raspberry Pi OS from Bullseye to Bookworm

In this guide, we will show you how to upgrade from Raspberry Pi OS Bullseye to Bookworm.

Raspberry Pi OS Upgrade to Bookworm from Bullseye

Let us start this guide by saying the process is incredibly risky, especially with the move to Bookworm. Raspberry Pi OS Bookworm introduced several significant changes that complicate the move from Bullseye.

While we can upgrade from Bullseye to Bookworm, you may be missing several changes after this upgrade. If you can, we highly recommend that you choose to start with a fresh installation of Bookworm.

Raspberry Pi OS Bookworm introduces a couple of significant changes. The first of these changes is the move to Network Manager for handling its networking. Second is the move from X11 to Wayland.

If you have decided to move to Bookworm, then be prepared to run through a few steps. Due to the renaming of the kernel packages this isn’t a straightforward upgrade process.

Like with any of our upgrade tutorials, ensure that you make a backup of your operating system before continuing. There is a significant risk core parts break during the upgrade process.

Equipment

Below is a list of the equipment we were using when we upgraded Raspberry Pi OS Bullseye to Bookworm.

Recommended

Optional

This tutorial was test on a Raspberry Pi 400 that was running Raspberry Pi OS Bullseye 32-bit.

Upgrading from Raspberry Pi OS Bullseye to Bookworm

Over the following sections, we will walk you through a method of upgrading Raspberry Pi OS from Bullseye to Bookworm.

It is important not to miss any of these steps as it can cause significant problems later in the guide.

Preparing your Raspberry Pi for an Upgrade

1. Before you start, you must install Network Manager on your Raspberry Pi by following our guide.

Moving move to Network Manager before you upgrade the operating system will make the process significantly smoother. If you don’t, networking can be broken upon upgrading your Raspberry Pi’s operating system.

2. You may continue once you have installed Network Manager and confirmed your networking is working properly.

3. Our next step is to ensure our operating system is entirely up to date.

You can do this by running the following two commands within the terminal. We use “dist-upgrade” here to ensure the latest versions are installed. You don’t want any out-of-date packages when we attempt the upgrade to Bookworm.

sudo apt update
sudo apt dist-upgrade -y

Updating the Raspberry Pi OS Repository from Bullseye to Bookworm

4. We are now at the point where we can change the official Raspberry Pi OS repositories to point to Bookworm instead of Bullseye.

Luckily, with some “sed” magic, we can do this with a couple of simple commands. This first command will replace any instances of “bookworm” in the “sources.list” file with “bullseye“.

sudo sed -i -e 's/bullseye/bookworm/g' /etc/apt/sources.list

5. Next, we must do the same to the “raspi.list” file located within the “/etc/apt/sources.list.d” directory.

sudo sed -i -e 's/bullseye/bookworm/g' /etc/apt/sources.list.d/raspi.list

Upgrading the Packages from Bullseye to Bookworm

6. At this stage, we can now upgrade all of the packages on our Raspberry Pi OS from their Bullseye version to Bookworm.

To perform this upgrade, use the following two commands in the terminal. Please note that this process can take some considerable time to complete.

sudo apt update
sudo apt full-upgrade -y

During the update, you may be asked whether you want services to be automatically restarted during setup. Select the “” option and press the ENTER key when you run into this prompt.

You will also get other prompts during this setup, so you will have to press ENTER to continue the upgrade process when the prompt pops up.

7. Once the upgrade has been completed, you can clean up any leftover packages using the following two commands.

sudo apt clean -y
sudo apt autoremove -y

8. Finally, we must restart to ensure our Raspberry Pi is now using the Bookworm version of the packages.

To restart, all you need to do is use the following command.

sudo reboot

Updating the Raspberry Pi OS Kernel from Bullseye to Bookworm

10. With the Raspberry Pi OS now using Bookworm packages, we must also upgrade the kernel.

Part of the problem here is that there has been a change in how the kernels are named. Please note that you must run the following commands in one sitting.

11. Our first step is purging the existing Raspberry Pi Bullseye bootloader and kernel using the following command.

We must remove these as they technically don’t exist on the Bookworm repository.

sudo dpkg --purge --force-depends raspberrypi-kernel raspberrypi-bootloader

12. Our next step is to temporarily unmount the boot partition so that we can make some changes.

sudo umount /boot

13. Next, run a quick file system check on the boot partition while we have it unmounted. This will fix and repair any disk errors with the partition.

sudo fsck -y /boot

14. We now need to create a directory where the new firmware files. The position of these firmware files is moved with the upgrade from Raspberry Pi OS Bullseye to Bookworm.

sudo mkdir /boot/firmware

15. We also need to re-adjust the “fstab” file so that it points to the new boot firmware location.

You can do this by using the following command.

sudo sed -i.bak -e "s#boot#boot/firmware#" /etc/fstab

16. With the changes we have made so far, we need to reload the system manager’s configuration running the command below.

sudo systemctl daemon-reload

17. At this point we can now, remount the “/boot/firmware” directory by using the command below.

sudo mount /boot/firmware

18. Finally, we can begin setting up the new Bookworm firmware.

You can re-install the firmware by running the following command.

sudo apt install raspi-firmware -y

19. The next step differs significantly depending on the version of Bullseye you are upgrading to Bookworm. Be careful you run the command relevant to your operating system; otherwise, this will stop your OS from booting.

a. If you are running a 64-bit version of Raspberry Pi OS, you must run the following command.

sudo apt install linux-image-rpi-v8 linux-headers-rpi-v8 -y

b. However, if you are running a 32-bit version of Raspberry Pi OS, run the command below.

You must also be running a Raspberry Pi 2 or newer to use the following command.

sudo apt install linux-image-rpi-v7l linux-headers-rpi-v7l -y

c. For those who are using a Raspberry Pi Zero, Zero W, Compute Module 1, or the original Raspberry Pi 1, then you must use the following command.

sudo apt install linux-image-rpi-v6 linux-headers-rpi-v6 -y

20. Now that we have re-installed the kernel and firmware for our Raspberry Pi, there is one last task we need to do before restarting.

Our next task is to add the “auto_initramfs” option to the config file by running the command below. With this enabled, the Raspberry Pi will use the new “initramfs” file included with the move from Raspberry Pi OS Bullseye to Bookworm.

The initramfs file is used to prepare a Linux system during boot.

sudo sed -i.bak '$ aauto_initramfs=1' /boot/firmware/config.txt 

21. Finally, we can restart our Raspberry Pi, and the move from Bullseye to Bookworm should be complete.

sudo reboot

Conclusion

Hopefully, you will have successfully upgraded Raspberry Pi OS from Bullseye to Bookworm at this stage.

This is one of the more intensive upgrade processes, with many things that can go wrong. We highly recommend that you start with a fresh Raspberry Pi OS Bookworm installation if you can.

Please feel free to comment below if you have any questions about upgrading to Bookworm.

If you found this tutorial to be useful, we highly recommend checking out our many Raspberry Pi tutorials.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Server Status

Aradippou Chat Larnaca Nicosia

Chat Links

Official Links.

Chat.

Alternative Mirror Links.

1. KiwiIRC 1.
2. KiwiIRC 2.

Other Web Clients.

1. IrcCloud.

Recent Posts

Related Posts:

Archives

Follow me on Mastodon

Super Club Radio

Mighty Deals

CyIRC

CyIRC Tweets