How to update a Raspberry Pi – step-by-step


You can trust PC GuideOur team of experts use a combination of independent consumer research, in-depth testing where appropriate – which will be flagged as such, and market analysis when recommending products, software and services. Find out how we test here.

Last Updated on

The Raspberry Pi is a versatile and affordable single-board computer that has gained immense popularity. Keeping your Raspberry Pi up-to-date is crucial to ensure optimal performance, security, and access to the latest features. That’s because every update brings some bugs and security fixes that can help improve your computer’s performance. But how will you do that? In this step-by-step guide, we will walk you through how to update your Raspberry Pi OS.

How to update Raspberry Pi

Updating a Raspberry Pi OS to Raspberry Pi 4 or soon to Raspberry Pi 5 is a straightforward process. But before starting the update, ensure you have a stable internet connection. Once you have established that, here are the steps to update the Raspberry Pi operating system.



Open a terminal window

Open a terminal window once your Raspberry Pi hardware is connected to the internet.

You can do this by clicking on the desktop terminal icon or using the keyboard shortcut – press Ctrl + Alt + T.

The terminal is your gateway to the command line, where you will execute the necessary commands for upgrading Raspberry Pi OS.



Update package lists

Start by updating the package lists on your Raspberry Pi. Type the following command and press Enter:

sudo apt update

This command retrieves the latest information about available packages from the repositories.

If you face any issues using this command, try switching to a different mirror.



Upgrade installed packages

The next step is to upgrade the installed old packages to the latest versions. You can do so by entering the following command into the terminal:

sudo apt full-upgrade

This command will find and upgrade any available packages required for updating Raspberry Pi OS.

If prompted, type ‘y’ and press Enter to confirm the upgrade. This process may take some time, depending on the number of packages that need to be updated.



Upgrade the distribution

To ensure you have the latest operating system version, perform a distribution upgrade. Enter the following command:

sudo apt dist-upgrade

Again, confirm if prompted. This command not only upgrades the installed packages but also handles changes in dependencies, ensuring a smooth and complete system upgrade.



Clean up

After upgrading, cleaning up unnecessary files and packages to free up disk space is a good practice. Here’s the command you can use for cleaning:

sudo apt autoremove

This command removes packages that were automatically installed but are no longer required. Once the additional packages are removed, you can go ahead with cleaning the system by using this command:

sudo apt clean



Reboot system

You must reboot your system if specific packages like Raspberry Pi’s kernel are updated. You can use this command to reboot:

sudo reboot

How to update Raspberry Pi: Conclusion

Regularly updating your Raspberry Pi device is essential for security, stability, and access to the latest features. By following these step-by-step instructions, you can effortlessly keep your Raspberry Pi up-to-date with the latest software, security patches and new features. But to do so, you must regularly check for available Raspberry Pi OS upgrades.


What does sudo apt update do?

The sudo apt update command will download package information from various configured sources.

What is the latest version of Raspberry Pi?

Raspberry Pi (4th gen) is the latest version of Raspberry Pi. However, Raspberry Pi 5 is all set to come in October 2023.

Gloria is a tech and AI writer for PC Guide. She is interested in what new technology means for the future of digital and broadcast journalism.