Update and Upgrade APT - spaceshiptrip/raspberrypi GitHub Wiki
Reference: https://www.raspberrypi.org/documentation/raspbian/updating.md
sudo apt update
sudo apt full-upgrade
Note thatfull-upgrade
is used in preference to a simpleupgrade
, as it also picks up any dependency changes that may have been made.
Generally speaking, doing this regularly will keep your installation up to date for the particular major Raspberry Pi OS release you are using (e.g. Stretch). It will not update from one major release to another, for example, Stretch to Buster.
However, there are occasional changes made in the Foundation's Raspberry Pi OS image that require manual intervention, for example a newly introduced package. These are not installed with an upgrade, as this command only updates the packages you already have installed.
Running out of space
When running sudo apt full-upgrade
, it will show how much data will be downloaded and how much space it will take up on the SD card. It's worth checking with df -h
that you have enough free disk space, as unfortunately apt will not do this for you. Also be aware that downloaded package files (.deb files) are kept in /var/cache/apt/archives
. You can remove these in order to free up space with sudo apt clean
(sudo apt-get clean
in older releases of apt
).