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-releaseLook 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 -rUpdate with one command
The fastest way to update your Raspberry Pi is with a single command:
sudo apt update && sudo apt full-upgrade -yThis 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-yflag automatically confirms the installation.
The update process can take 5–30 minutes depending on how many packages need updating and your internet speed.
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 updateThis downloads the latest package lists from Raspberry Pi repositories. No files are installed yet.
2. Review available upgrades
apt list --upgradableThis shows which packages have updates available.
3. Upgrade all packages
sudo apt full-upgradeType Y when prompted to confirm the installation.
4. Clean up old packages
sudo apt autoremove -yRemoves packages that were installed as dependencies but are no longer needed.
sudo apt autocleanClears 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-updateIf an update is available, you'll see a message showing the current and latest versions.
Install firmware update
sudo rpi-eeprom-update -a
sudo rebootThe 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.
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 updateRunning out of disk space
Check available space:
df -hIf your SD card is nearly full, remove old packages and cached files:
sudo apt autoremove -y
sudo apt autocleanOr expand your filesystem if you upgraded to a larger SD card:
sudo raspi-configSelect Advanced Options → Expand Filesystem, then reboot.
Need more help?
Visit the Vilros Learn Center or contact Vilros support.