Keeping your Raspberry Pi Up-to-date
Basically any time you want to add programs, make changes, do anything on the Pi you want to run these two commands to make sure everything stays up-to-date and functioning.
sudo apt-get update && sudo apt-get upgrade
The apt-get update
gets a list of all available packages (based on what you’ve got installed) and their current versions. It doesn’t actually do anything other that update that list.
The apt-get upgrade
then uses that list to know which packages need to be upgraded, and downloads and installs those upgrades.
To do a bit more in the update, you can change the upgrade
to dist-upgrade
. While upgrade
just updates installed packages, dist-upgrade
will find and install dependencies, or remove packages and dependencies it deems no longer required.
sudo apt-get update && sudo apt-get dist-upgrade
If you’re not happy with other things being added, or are uncomfortable with things being automatically removed, then stick to just using upgrade
. If you want everything handled for you then you can use dist-upgrade
.
For further reading: