Skip to content

How-to / Raspberry Pi

How to update your Raspberry Pi

Keep your Raspberry Pi secure, stable, and performing at its best with regular updates. Learn how to update the OS, packages, and firmware in just a few commands.

BeginnerMaintenance · 10–30 minBy Vilros

Why update?

Regular updates are essential for:

  • Security: Patches fix vulnerabilities that could compromise your Pi.
  • Stability: Bug fixes improve system reliability and prevent crashes.
  • Performance: Optimizations and driver updates can boost speed.
  • New features: Access the latest tools and capabilities.

Raspberry Pi OS receives frequent updates from the Raspberry Pi Foundation. It's good practice to update your Pi monthly or before starting a new project.

Check your OS version

Before updating, check which version of Raspberry Pi OS you're running:

cat /etc/os-release

Look for the VERSION and VERSION_CODENAME lines. Current releases include Bookworm (Debian 12), Bullseye (Debian 11), and older versions.

To see your kernel version:

uname -r

Update with one command

The fastest way to update your Raspberry Pi is with a single command:

sudo apt update && sudo apt full-upgrade -y

This command does two things:

  • sudo apt update — Refreshes the list of available packages and their versions.
  • sudo apt full-upgrade -y — Installs all available updates, including kernel and firmware updates. The -y flag automatically confirms the installation.

The update process can take 5–30 minutes depending on how many packages need updating and your internet speed.

Why full-upgrade instead of upgrade?

apt full-upgrade handles package dependencies more intelligently, removing obsolete packages and installing new ones when needed. apt upgrade is more conservative and may skip some updates.

Upgrade packages step-by-step

If you prefer to see what's being updated before proceeding, run the commands separately:

1. Update package lists

sudo apt update

This downloads the latest package lists from Raspberry Pi repositories. No files are installed yet.

2. Review available upgrades

apt list --upgradable

This shows which packages have updates available.

3. Upgrade all packages

sudo apt full-upgrade

Type Y when prompted to confirm the installation.

4. Clean up old packages

sudo apt autoremove -y

Removes packages that were installed as dependencies but are no longer needed.

sudo apt autoclean

Clears cached package files to free up disk space.

Update firmware (Pi 4 and newer)

Raspberry Pi 4, Pi 5, and Pi 400 use EEPROM firmware for boot and USB functionality. Update it separately:

Check for firmware updates

sudo rpi-eeprom-update

If an update is available, you'll see a message showing the current and latest versions.

Install firmware update

sudo rpi-eeprom-update -a
sudo reboot

The Pi will apply the firmware update during the next boot. This takes about 10 seconds and the green LED will blink rapidly during the update.

Important: Do not disconnect power during a firmware update. Wait for the Pi to fully boot after rebooting.

Troubleshooting

Update fails: "Could not get lock"

This means another process is using the package manager. Wait for other updates or installations to finish, then try again. If the error persists:

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock*

"Unable to fetch some archives"

This indicates a network or repository issue. Check your internet connection, then try:

sudo apt clean
sudo apt update

Running out of disk space

Check available space:

df -h

If your SD card is nearly full, remove old packages and cached files:

sudo apt autoremove -y
sudo apt autoclean

Or expand your filesystem if you upgraded to a larger SD card:

sudo raspi-config

Select Advanced Options → Expand Filesystem, then reboot.

Need more help?

Visit the Vilros Learn Center or contact Vilros support.