update raspberry pi os to the latest version

Upgrade Raspberry Pi OS to the Latest Version (2024)

Raspberry Pi OS is based on Debian and follows its versions, usually with some time lag between the two. The latest Raspberry Pi OS version available for download is currently “Bullseye”, based on Debian 11, but it’s already possible to try the one based on Debian 12 (aka “Bookworm”). Whether you don’t have Bullseye yet or want to try the beta version, you are in the right place.

To upgrade Raspberry Pi OS to a newer version, the list of repositories for APT (the package manager) should be edited. Once done, we can run the APT commands “update” and “upgrade” to install the new versions of all packages.

In this tutorial, I’ll show you how to upgrade your system by editing the APT configuration file and installing all the new packages.

Note: This guide has been updated, to explain how to upgrade RPI OS Bullseye to Bookworm, but you can use the same tips to upgrade Buster to Bullseye, which is now officially the stable version. Keep in mind that the Raspberry Pi Foundation recommends installing the system from scratch, instead of upgrading it as explained in this tutorial.

If you’re looking to quickly progress on Raspberry Pi, you can check out my e-book here. It’s a 30-day challenge where you learn one new thing every day until you become a Raspberry Pi expert. The first third of the book teaches you the basics, but the following chapters include projects you can try on your own.

Raspberry Pi OS versions

Before going further, you need to know which version you are currently using, and the new versions available.
As previously mentioned, Raspberry Pi OS is based on Debian and follows the same versions:

Debian versionCode nameRelease date
Debian 8JessieSeptember 2015
Debian 9StretchAugust 2017
Debian 10BusterJune 2019
Debian 11BullseyeNovember 2021
Debian 12BookwormJune 2023
Debian and Raspberry Pi OS versions

Yes, all of the code names are based on Toy Story characters :).
You can check this guide to determine which version you currently have, and this introduction article to Raspberry Pi OS if you are not yet confident with it.

If you have a recent Raspberry Pi model, you also need to use a recent Raspberry Pi OS version. For example, Raspberry Pi 4 won’t boot on Stretch and Raspberry Pi 3B+ doesn’t work on Jessie.

During writing, the current stable version is Raspberry Pi OS Bullseye.
If you are using an older version, it’s a good time to update it.

Download Your Essential Linux Commands Guide!
It's a free PDF guide containing every Raspberry Pi Linux command you should know!
Download now

Raspberry Pi OS Bookworm is not yet considered stable by the Raspberry Pi Foundation, so it’s not included in Raspberry Pi Imager or on their website. But the release date is coming soon, and repositories for Raspberry Pi OS are already up and running. That’s why you can now update to test it (I don’t recommend it in production, or with essential services, however).

Download Your Essential Linux Commands Guide!
It's a free PDF guide containing every Raspberry Pi Linux command you should know!
Download now

Updating sources.list

As mentioned in the introduction, we use APT to update all the packages on the system (either directly or with a graphical tool intermediate). APT checks for new updates available on the repositories and suggests installation.

The easiest way to upgrade your system to a new version is to change the repositories used by APT. But I also have an alternative to upgrading without commands if you are averse to it :).

Warning: Before going further, creating a backup of your SD card is probably a good idea. If anything is broken after the installation, you’ll still have a way to easily come back to the current state of your system.

Upgrade Raspberry Pi OS from the terminal

So, start by opening a terminal.
You can do this via a GUI (Graphical User Interface), on Raspberry Pi OS Lite or even via an SSH connection, it doesn’t matter.

Start by updating your system with the current repositories, you want the latest packages available for the current version before upgrading everything to the latest one:
sudo apt update
sudo apt upgrade -y

Reboot the Raspberry Pi if there were many updates:
sudo reboot

Then, we’ll change the repositories used to upgrade to the latest Raspberry Pi OS (beta) version:

  • Open the sources.list file with:
    sudo nano /etc/apt/sources.list
    If you are new to this editor, you can find my complete Nano guide with the commands and shortcuts here.
  • You’ll see one or more lines like this:
    deb http://deb.debian.org/debian bullseye main contrib non-free
  • Edit these lines and replace the current Debian code name with the one you want to install, for example:
    deb http://deb.debian.org/debian bookworm main contrib non-free
    If there are several lines, change all of them the same way (bookworm-security, bookworm-updates, etc.).

    It’s a good idea to update it step-by-step, one version at a time.
  • Save and exit this file (CTRL+O, CTRL+X).

Note: Depending on your system versions and additional packages, you may have other configuration files under /etc/apt/sources.list.d. Edit them following the same steps.

The next step is to make a complete upgrade of your system:

  • Update the package lists:
    sudo apt update

    As you can see, all the URLs are now including “bookworm” instead of “bullseye”.
  • Then upgrade everything with:
    sudo apt upgrade
  • Press “Y” to confirm the installation.
    It will start downloading all the packages now. It might take a while, especially if you have a slow connection.
  • Press “q” to exit the list of changes when it shows up.
  • Depending on the packages you have, you might have to answer a few questions during the installation (overwrite configuration, restart services, etc.).

    So, you can’t even leave your screen for too long, it won’t do everything automatically :-).
  • After that, I recommend running this other command to install the latest version of everything:
    sudo apt dist-upgrade
    It’s not mandatory, but it’s generally recommended for a major upgrade like that, to make sure all dependencies are up-to-date and linked correctly to the latest version.
    It’s the same process, confirm the downloads with “Y”, press “q” to close the changes list, and wait a few more minutes to complete the installation.

It will take a while to download and install all the new packages (over 1000 in my case).
Once done, it’s a good idea to reboot your system to apply all changes directly:
sudo reboot

That’s it, I’m now up-to-date with Bookworm running on my Raspberry Pi 4:

Download Your Essential Linux Commands Guide!
It's a free PDF guide containing every Raspberry Pi Linux command you should know!
Download now

Are you a bit lost in the Linux command line? Check this article first for the most important commands to remember and a free downloadable cheat sheet so you can have the commands at your fingertips.

Upgrade Raspberry Pi OS with the GUI

As promised, here is how to do this if you want to avoid the command line.
By default, I don’t think there is a way to do it easily. The Add / Remove package tool can’t edit the sources file, you can also see the current repositories.

Synaptic is an alternative to the “Add / Remove package” tool included with Raspberry Pi OS, that can be used to upgrade Raspberry Pi OS to the latest version by using only the GUI.

Here is how to install it on your Raspberry Pi:

  • In the main menu, go to Preferences > Add/remove software.
  • Type “synaptic” in the search engine.
  • Install the package named Synaptic.
  • Once done, open it from the same location in the main menu.
  • In the top menu, you’ll find an entry “Repositories” under “Settings”:
  • Then in the new window, you can see and edit the repositories addresses:
  • Click on each enabled repository and replace the distribution name with the one you want to upgrade to.
    If your system is old, try to do it with incremental steps (don’t update from Jessie to Bullseye directly for example).
  • Click on “OK” to save your changes.

Once done, you can use Synaptic to update all the packages (use the icons in the top bar), or go back to the “Add / remove software” tool if you prefer.

Either way, your system is now up-to-date.
If you are trying Bookworm before the official release date, you might have a few bugs, but in general, Debian is pretty stable, even as a development release.

Cleaning up

After the upgrade, you can generally save some disk space by running these commands:
sudo apt autoremove
sudo apt autoclean

This will uninstall the dependencies that are no longer required, and clean the packages cache.

Download Your Essential Linux Commands Guide!
It's a free PDF guide containing every Raspberry Pi Linux command you should know!
Download now

🛠 This tutorial doesn't work anymore? Report the issue here, so that I can update it!

If you are looking for exclusive tutorials, I post a new course each month, available for premium members only. Join the community to get access to all of them right now!

FAQ

How to update the Raspberry Pi firmware?

The Raspberry Pi firmware is installed as a Debian package and is updated automatically with apt. If you use “sudo apt upgrade” regularly, your firmware is already up-to-date.

As a reminder, the firmware and the OS are two different things. The firmware tells the hardware how to start up, while the system controls everything once the device is up and running.

What is the latest Raspberry Pi OS version?

The current stable version of Raspberry Pi OS is Bullseye. The next release will be Bookworm which is available in testing, while Buster is still supported, as a legacy version (not all applications are yet compatible with Bullseye).

How long does the upgrade process typically take?

Upgrade durations vary, ranging from 30 minutes to 2 hours, depending on the Internet speed, the Raspberry Pi model and hardware (SD card vs SSD), and the number and size of packages to upgrade.

I would schedule at least one hour for a typical upgrade on a Raspberry Pi 4. Maybe 2 hours if you have plenty of applications or an older model.

How do I roll back to a previous version if I encounter issues?

Rolling back to a prior version of Raspberry Pi OS requires restoring from a pre-upgrade backup. That’s why it’s highly recommended to do a full backup of the SD card before major updates.

If you don’t have a backup and experience issues, the second-best option is then to reinstall the system from scratch, and copy your data from the previous installation.

When will Raspberry Pi OS Bookworm be released officially?

The release date for Raspberry Pi OS Bookworm is currently unknown. However, Debian Bookworm was released on 10 June 2023, so the Raspberry Pi version should be available soon (in a few months probably).

As mentioned here, there are generally a few months between the Debian release and the Raspberry Pi OS released. The longer it took for the previous versions was 3 months (between Debian Bullseye and RPI OS), so we can expect it to be available really soon.

❤️ Love Raspberry Pi & writing?
Combine your passions and get paid. Write for RaspberryTips!

What new features can I expect in Raspberry Pi OS Bookworm?

Raspberry Pi OS Bookworm will offer enhanced performance, security, and broader hardware support, mirroring many Debian Bookworm updates.

But basically, there are few differences for the end-user between one version to the next. Especially as we are still using Debian currently, not the final version of Raspberry Pi OS Bookworm, that might come with new features.

Whenever you’re ready, here are other ways I can help you:

The RaspberryTips Community: If you want to hang out with me and other Raspberry Pi fans, you can join the community. I share exclusive tutorials and behind-the-scenes content there. Premium members can also visit the website without ads.

Master your Raspberry Pi in 30 days: If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.

The Raspberry Pi Bootcamp: Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.

Master Python on Raspberry Pi: Create, understand, and improve any Python script for your Raspberry Pi. Learn the essentials step-by-step without losing time understanding useless concepts.

You can also find all my recommendations for tools and hardware on this page.

Similar Posts

4 Comments

  1. Is the 64 bit (arm64) version of Bullseye ready to try on the Raspberry Pi 4B yet?

    1. “Ready to try” is the correct answer yes 🙂
      It’s not yet available as the default release, but it’s stable enough to test it.

Comments are closed.