How to Upgrade Raspberry Pi OS to the Latest Version (2023)


Note: This guide has been updated in November 2021, 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 Bullseye from scratch, instead of upgrading it as explained in this tutorial.

Raspberry Pi OS is based on Debian and follows its versions. The latest Raspberry Pi OS version available for download is currently “Bullseye”, based on Debian 10. If you’re behind and need to update your Raspberry Pi OS or want to try the next version (“Bookworm” e.g. Debian 12), you are in the right place.

Raspberry Pi OS uses package repositories to download new updates and upgrade the software to the latest version. You can use repositories to upgrade your software to the latest versions without losing any data. The URL is set in /etc/apt/sources.list.

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

If you are 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.

I answer your questions - Raspberry...
I answer your questions - Raspberry Pi FAQ

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:

Get My Commands Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!
Debian versionCode nameRelease date
Debian 8JessieSeptember 2015
Debian 9StretchAugust 2017
Debian 10BusterJune 2019
Debian 11BullseyeNovember 2021
Debian 12BookwormNot released yet, likely in 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 have to use a recent Raspberry Pi OS version. For example, Raspberry Pi 4 doesn’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 old version, it’s a good idea to update it.

Raspberry Pi OS Bookworm is not yet considered stable, 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).

Updating sources.list

As mentioned in the introduction, we use APT to update all of 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 :).

Before going further, creating a backup of your SD card might be 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.

From a terminal

So, start by opening a terminal.
You can do this on Desktop, 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

Get My Commands Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!

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).

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

  • Update the package lists:
    sudo apt update
  • Then upgrade everything with:
    sudo apt upgrade
  • Press “Y” to confirm the installation.
    It will start downloading all the packages now.
  • Press “q” to exit the apt-listchanges text if there is one.
  • 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 :-).

It will take a while to download and install all the new package (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:

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.

With a desktop tool

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.

But you can install Synaptic to do it:

  • 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 on a development release.

Get My Commands Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!

Reminder: Remember that all the members of my community get access to this website without ads, exclusive courses and much more. You can become part of this community for as little as $5 per month & get all the benefits immediately.

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.

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).

Get My Commands Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!

Additional Resources

Not sure where to start?
Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.
Watch the Raspberry Pi Bootcamp course now.

Master your Raspberry Pi in 30 days
Don’t want the basic stuff only? 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.
Download the e-book.

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

Need help building something with Python?
Create, understand and improve any Python script for your Raspberry Pi.
Learn the essentials, step-by-step, without losing time understanding useless concepts.
Get the e-book now.

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

Patrick Fromaget

I'm the lead author and owner of RaspberryTips.com. My goal is to help you with your Raspberry Pi problems using detailed guides and tutorials. In real life, I'm a Linux system administrator with a web developer experience.

Recent Posts