How do you update and upgrade the Raspberry Pi OS?

 To update and upgrade Raspberry Pi OS, you use the terminal and a few simple commands. Here’s a clean, step-by-step guide:\




1. Open Terminal

You can access the terminal via:

  • Desktop: Menu → Accessories → Terminal

  • Headless SSH: Connect remotely via SSH (e.g., ssh pi@raspberrypi.local)


2. Update Package List

bash

sudo apt update

This checks the repositories and fetches the latest list of available packages.


3. Upgrade Installed Packages

bash

sudo apt full-upgrade
  • This installs new versions of packages and removes obsolete ones if needed.

  • Safer and more thorough than apt upgrade.


4. Clean Up (Optional)

bash

sudo apt autoremove sudo apt clean
  • Frees space by removing unused packages and cached files.


5. Update Raspberry Pi Firmware (Optional)

For updating bootloader, kernel, and firmware:

bash

sudo rpi-update

Use with caution! Only use this if you need the latest bleeding-edge firmware (e.g., for hardware fixes). It’s not part of standard updates.


6. Reboot

bash

sudo reboot

 Summary Table

StepCommandPurpose
Update listsudo apt updateRefreshes available packages
Upgrade systemsudo apt full-upgradeApplies updates and removes old
Clean upsudo apt autoremoveDeletes unused packages
Firmware update (opt)sudo rpi-updateGets latest kernel/firmware
Rebootsudo rebootApplies changes

评论

此博客中的热门博文

Detailed Explanation of STM32 HAL Library Clock System

How To Connect Stm32 To PC?

How to add a GPS sensor to ESP32 for Wokwi?