Updating Raspberry Pi OS means keeping the operating system packages up to date in order to receive fixes, improvements, and security patches.
For this we will use the APT tool, the usual package manager on Debian-based systems such as Raspberry Pi OS.
Do not confuse updating packages with jumping to a major operating system version. To move from one Debian base to another (for example, from Bullseye to Bookworm, or from Bookworm to Trixie) the recommended approach is to make a backup and install a fresh image with Raspberry Pi Imager. “In-place” upgrades can work, but they can also leave you with a weird system, which then becomes exactly the kind of party nobody wants.
The process for updating installed packages is very similar to a normal software update. For a complete package update we can use:
sudo apt-get -y dist-upgrade
This command performs the same actions as upgrade, that is, it updates the installed packages to the latest version. But, additionally, dist-upgrade is also capable of adding uninstalled packages or removing obsolete ones.
So, in essence, after running dist-upgrade we will have the installed packages updated more completely than with a simple upgrade, but it does not magically turn our installation into a clean image of the new major version.
Additional packages (extra programs, etc...) that are included in a new image will not be installed automatically, because we never had them installed.
If we are interested in these packages, we will have to install them manually. Fortunately, in general, we won’t be interested in these packages
Update Raspberry Pi OS
Let’s see the complete process to update Raspberry Pi OS packages. First, we check the current version with the following command:
uname -a
Next, we execute the following commands to update the system packages:
sudo apt-get -y update sudo apt-get -y dist-upgrade sudo apt-get -y autoremove sudo apt-get autoclean sudo reboot
With this, we are updating all the system packages, then we clean the local package repository and, finally, we reboot the Raspberry Pi.
The complete update process can be long, even taking an hour or more. For this reason, we have used the -y parameter, which prevents the commands from asking if we want to continue, and the process stops because it’s waiting for us to say yes.
Once the update process is finished and the Raspberry Pi has rebooted, we check the system version again with:
uname -a
Checking that, indeed, the system boots correctly after the update.
Install Experimental Kernel
Additionally, it is possible to update the firmware and kernel to very recent versions (including unstable ones) with the following command:
rpi-update
Although at first glance it may seem like the “normal” command, it is very important to emphasize that rpi-update installs test firmware and kernel versions. Therefore, in general, it is not recommended to use this command on a normal system unless you know exactly why you need it.
Recover Original Firmware
If at any time you have tried to update the firmware and have had the bad luck of hitting an error, as long as we can still open a command console we can recover the original firmware with the following command:
sudo apt-get install —reinstall raspberrypi-bootloader raspberrypi-kernel
If this doesn’t work, well, you know, brick. We will have to reinstall the operating system from scratch and start over from the beginning.

