Raspberry Pi recently launched Bookworm, and with that, a new kernel package.
However, due to the massive changes from Bullseye to Bookworm, they are not suggesting a
In the past, we have suggested procedures for updating an existing image to the new version, but always with the caveat that we do not recommend it, and you do this at your own risk.
This time, because the changes to the underlying architecture are so significant, we are not suggesting any procedure for upgrading a Bullseye image to Bookworm; any attempt to do this will almost certainly end up with a non-booting desktop and data loss.Bookworm — the new version of Raspberry Pi OS
But screw that, ain’t nobody got time to reinstall all their RPis in the wild (and in all fairness, I’ve had zero issues updating; just some messing around with kernels — hence the post)…
As this is not very well documented, and Raspberry Pi, across all their versions, has 4 different architectures, it’s confusing.
There’s a quick dirty guide on how to update from
However, it’s unclear in terms of which kernel to pick, so here goes:
- RPi3 (including RPi4) and newer in 64 bit1 (aarch64):
apt install -y linux-image-rpi-v8 linux-headers-rpi-v8
- RPi4 and 400 in 32 bit2:
apt install -y linux-image-rpi-v7l linux-headers-rpi-v7l
- RPi2 (only 32bit) or 3, 3+, Zero 2 W, Compute Modules 3 and 3+ in 32 bit mode3 (armhf):
apt install -y linux-image-rpi-v7 linux-headers-rpi-v7
- RPi1, Zero, Zero W, Compute Module 1 (armel):
apt install -y linux-image-rpi-v6 linux-headers-rpi-v6
This mostly comes from here.
So, in short, this is what worked for me. As I use Wireguard as well, I needed to remove the package first to prevent conflicts.
apt remove -y wireguard apt autoremove -y dpkg --purge --force-depends raspberrypi-kernel raspberrypi-bootloader umount /boot fsck -y /boot mkdir /boot/firmware sed -i.bak -e "s#boot#boot/firmware#" /etc/fstab systemctl daemon-reload mount /boot/firmware apt install raspi-firmware -y # rpi3+ 64bit #apt install linux-image-rpi-v8 linux-headers-rpi-v8 # rpi4+ 32bit #apt install linux-image-rpi-v7l linux-headers-rpi-v7l # rpi2 and rest #apt install linux-image-rpi-v7 linux-headers-rpi-v7 # rpi1 #apt install linux-image-rpi-v6 linux-headers-rpi-v6 sed -i.bak '$ a\auto_initramfs=1' /boot/firmware/config.txt apt install wireguard -y systemctl enable wg-[email protected] systemctl start [email protected] # reboot
apt install <kernel> — do write down the package it’ll install. The listed packages are just meta packages and will pull a bunch of other packages that actually hold the important files. Running
apt --reinstall on those meta packages, for example, won’t actually reinstall the kernel.
To roll back, you can purge those packages and reinstall
raspberrypi-kernel raspberrypi-bootloader (be aware of the path changes in
/boot). If you made a mistake, just
apt install --reinstall -y <all the packages you wrote down> and it should reinstall everything.