Skip to content

Instantly share code, notes, and snippets.

@jauderho
Last active August 11, 2025 19:18
Show Gist options
  • Save jauderho/5f73f16cac28669e56608be14c41006c to your computer and use it in GitHub Desktop.
Save jauderho/5f73f16cac28669e56608be14c41006c to your computer and use it in GitHub Desktop.
HOWTO: Upgrade Raspberry Pi OS from Bookworm to Trixie
### WARNING: READ CAREFULLY BEFORE ATTEMPTING ###
#
# Officially, this is not recommended. YMMV
# https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/
#
# This mostly works if you are on 64bit. You are on your own if you are on 32bit or mixed 64/32bit
#
# Credit to anfractuosity and fgimenezm for figuring out additional details for kernels
#
# Make sure everything is up-to-date
sudo apt-get update && sudo apt-get dist-upgrade
# Point to bookworm repos instead
sudo sed -i -e 's/bookworm/trixie/g' /etc/apt/sources.list
sudo sed -i -e 's/bookworm/trixie/g' /etc/apt/sources.list.d/raspi.list
# Contents of /etc/apt/sources.list
deb http://deb.debian.org/debian trixie main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian trixie-updates main contrib non-free non-free-firmware
# Uncomment deb-src lines below then 'apt-get update' to enable 'apt-get source'
#deb-src http://deb.debian.org/debian trixie main contrib non-free
#deb-src http://security.debian.org/debian-security trixie-security main contrib non-free
#deb-src http://deb.debian.org/debian trixie-updates main contrib non-free
# Contents of /etc/apt/sources.list.d/raspi.list
deb http://archive.raspberrypi.org/debian/ trixie main
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ trixie main
# Do actual update
sudo apt update && sudo apt -y full-upgrade && sudo apt -y clean && sudo apt -y autoremove
# Reboot
sudo reboot
# Modernize sources
sudo apt modernize-sources
# Make sure the following is in /etc/apt/sources.list.d/raspi.sources. The Signed-by: may be missing
Types: deb
URIs: http://archive.raspberrypi.org/debian/
Suites: trixie
Components: main
Signed-By: /usr/share/keyrings/raspberrypi-archive-keyring.gpg
# Remove the raspi.list.bak after confirming that everything works
rm /etc/apt/sources.list.d/raspi.list.bak
@karianneberg
Copy link

Thanks for your guide - it worked like a charm! To update the Raspberry Pi firmware and kernel as well, I ran:
sudo rpi-update
followed by:
sudo reboot
This was done after updating to Trixie and verifying that the Trixie upgrade was successful.

@kenneyd
Copy link

kenneyd commented Aug 11, 2025

@jauderho Thanks for the guide, it worked for me.

In the last line, I think there's a typo:
rm /etc/apt/sources.list.d/raspbi.list.bak has raspi misspelled, I think it should be rm /etc/apt/sources.list.d/raspi.list.bak

@jauderho
Copy link
Author

@geerlingguy Oops...

@kenneyd Thanks for the catch. Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment