Linux

How to Update to the Latest Raspberry Pi OS

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

***

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 simply want to get your hands dirty in the terminal, this is also an option.

Whatever method you’re using to upgrade to Raspberry Pi OS, take the time to back up any vital data stored on the Raspberry Pi’s SD card 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

Once that has completed, update the Raspberry Pi firmware with:

sudo rpi-update

Upgrading to Raspbian Buster means switching repositories. This is easily done in the terminal by editing the sources:

sudo nano /etc/apt/sources.list

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

deb http:

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

deb http:

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

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

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 directly from an old Raspbian version to Raspberry Pi OS — it has to be via Raspbian Buster.

Here’s how to update Raspbian to Raspberry Pi OS

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 with 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:

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

deb http:

You can then run the update and upgrade commands:

sudo apt update
sudo apt dist-upgrade

When this completes, use the autoclean instruction to discard of 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.

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 dependency to the upgraded software are also included, saving time later.

How to Download and Install Raspberry Pi OS to SD Card

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

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

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

Meanwhile, two 64-bit versions can be downloaded for installation:

  • Raspberry Pi OS with desktop
  • Raspberry Pi OS Lite

In addition, some older versions can be downloaded, 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 the Raspberry Pi OS to an SD card:

  • 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, so 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. Remember to update regularly.

Source link

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button