Need to update your Raspberry Pi to the latest version of its default operating system, but can't work out how to do it?

Since Raspbian was replaced by Raspberry Pi OS, things have changed a little. Here’s what you need to know about updating Raspberry Pi OS.

Why You Need to Upgrade From Raspbian to Raspberry Pi OS

You’re already running Raspbian on your Raspberry Pi. So why do you need to upgrade?

Raspberry Pi OS was first released in 2012 as Raspbian. Since 2020, following the release of a 64-bit beta version based on Debian rather than the Raspbian project, the operating system has been known as Raspberry Pi OS.

The same change has since been made to the 32-bit version, although this continues to be referred to as Raspbian and is primarily aimed at older Pi models.

Raspberry Pi OS comes with a number of useful applications preinstalled. These include LibreOffice, Python, Scratch, Sonic Pi, and much more.

Installing the latest Raspberry Pi updates is straightforward, and can be done in the terminal. But to upgrade to Raspberry Pi OS, you can either:

  • Manually upgrade in the terminal
  • Flash a fresh image from scratch using SD card writing software

Below we'll look at the options for each. The following steps work for all consumer versions of the Raspberry Pi, including the Pi Zero and Raspberry Pi 4, so you won't need to check what model Raspberry Pi you have.

Update From Raspbian to Raspberry Pi OS

The simplest way to update Raspbian to Raspberry Pi OS is to flash a new image. But if you need to retain data on your microSD card or SSD or simply want to get your hands dirty in the terminal, this is also an option.

Whatever method you use to upgrade to Raspberry Pi OS, take the time to back up any vital data stored on the Raspberry Pi's SD card or SSD first.

To upgrade Raspbian to Raspberry Pi OS, you first have to ensure your copy of Raspbian is fully upgraded. It needs to be at the point where everything is in place for a straightforward Raspberry Pi OS upgrade.

This means upgrading from Raspbian Stretch (or Jessie, or Wheezy, etc.) to Raspbian Buster.

Upgrade Raspbian to Raspbian Buster

Open a terminal and enter:

        sudo apt update
sudo apt dist-upgrade -y

With that out of the way, update the Raspberry Pi firmware with:

        sudo rpi-update
    

Upgrading to Raspbian Buster means switching repositories. This is easily done in the terminal by using the nano text editor to edit the sources:

        sudo nano /etc/apt/sources.list
    

Use the arrow keys to browse through the list until you find:

        deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
    

Change this line, replacing "stretch" (or whichever version of Raspbian your system is running) with "buster":

        deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
    

Press Ctrl + X to save and exit, then remove a large changelog file:

        sudo apt-get remove apt-listchanges
    

This will save time when the operating system updates.

With the sources updated, you can run a full package update and upgrade:

        sudo apt update
sudo apt dist-upgrade
Launch the terminal to upgrade Raspbian

This will take a while to complete, so be patient. When done, use:

        sudo apt autoremove -y
    

...to discard old packages with changed dependencies, then run:

        sudo apt autoclean
    

This clears the package cache, removing data no longer available for download, and saving space on your Raspberry Pi. To complete the upgrade to Raspbian Buster, reboot.

        sudo reboot
    

At this stage, you could carry on using your Raspberry Pi with an OS that is reasonably up-to-date. But it would still be Raspbian.

Upgrade Raspbian to Raspberry Pi OS

A similar procedure is required to upgrade Raspbian to Raspberry Pi OS. Because of the various prerequisites and dependencies involved, you cannot simply upgrade from an old Raspbian version to Raspberry Pi OS—it has to be via Raspbian Buster.

To update Raspbian to Raspberry Pi OS, first, open a terminal and enter:

        sudo apt update
sudo apt dist-upgrade -y

Wait for completion, then run the firmware update:

        sudo rpi-update
    

As before, you need to edit the sources.list file to point to the correct resource.

        sudo nano /etc/apt/sources.list
    

In this file, look for the following line:

        deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
    

Change the line, replacing “buster” with “bullseye”:

        deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
    

You can then run the update and upgrade commands:

        sudo apt update
sudo apt dist-upgrade
muo-linux-upgrade-raspberry-pi-os

When this completes, use the autoclean instruction to discard unused update files, then reboot.

        sudo apt autoclean
sudo reboot

When the Raspberry Pi restarts, the upgraded Raspberry Pi OS will be running.

How to Update Raspberry Pi OS

With your system fully up-to-date, remember to regularly check for updates. You can do this in the terminal with the following commands:

        sudo apt update
sudo apt full-upgrade

The full-upgrade command is used instead of upgrade as it ensures dependencies of the upgraded software are also included, saving time later.

Download and Install Raspberry Pi OS to SD Card or SSD

If you prefer to start from scratch with Raspberry Pi OS, you can save time by simply installing the latest release on a microSD card or SSD. Should this involve using the same microSD card, back up any vital data before proceeding.

For fresh installations, three 32-bit versions of Raspberry Pi OS are available:

  • Raspberry Pi OS with desktop
  • Raspberry Pi OS with desktop and recommended software
  • Raspberry Pi OS Lite

Meanwhile, you can choose between two 64-bit versions for installation:

  • Raspberry Pi OS with desktop
  • Raspberry Pi OS Lite

It's easy to add a desktop to Raspberry Pi OS Lite if you change your mind later.

In addition, you can also download some older versions, such as Raspberry Pi OS (Legacy) and the version based on Debian Buster. As you might have guessed, these are available for legacy applications, where using Raspberry Pi OS results in bugs or incompatibilities. They’re also more suitable for older Raspberry Pi models.

Download: Raspberry Pi OS

There are six options available to you for installing Raspberry Pi OS:

  • Raspberry Pi Imager
  • balenaEtcher
  • The dd command in the terminal
  • NOOBS
  • Berryboot
  • PINN Lite

Steps for each of these methods are covered in our guide to installing an operating system on the Raspberry Pi.

It’s Time to Update Raspbian on Your Raspberry Pi

Older Raspbian operating systems are enough to get a Raspberry Pi up and running, but lack many features. This should come as no surprise—as the Raspberry Pi has developed in capabilities, the operating system has been enhanced.

The steps above are all you need to upgrade to the latest version of Raspberry Pi OS and keep things updated. Always remember to update your operating system regularly.