You need to keep the software on your Raspberry Pi up to date so that you have access to the latest features, improvements, and security fixes. Many operating systems tell you when updates of the core software and other applications are available, and encourage you to complete the update immediately. Most Linux distributions are a little different and allow you to decide when to update; this means that you have control over when updates take place and can see what changes are being made, which is very useful if updating one piece of software breaks another piece of software, as it sometimes does.
Although on Raspberry Pi OS you can manage updates using the Add/Remove Software tool, most experienced Linux users prefer to use the terminal to manage updates, so you will often find instructions for installing or updating software using the command line.
A package contains all the files for a particular piece of software or application. On Raspberry Pi OS, there is a program called APT (Advanced Package Tool), which you can use to manage the installation, updating, and removal of software. You can think of it a little like an app store such as the Microsoft Store for Windows, the App Store for Apple devices and macOS, or the Play Store for Android.
Unlike the stores on other operating systems, APT doesn’t constantly update the list of available software or the latest versions of different applications. You need to find out manually.
This means there are two separate steps:
Update, which finds out the latest versions of software that are available
Upgrade, which installs those latest versions
To update the list of all available software, use the command:
apt update
If you try this in your terminal, you should see lots of Permission denied messages. This is because you have to be an administrator on your machine to install, upgrade, or delete software. The administrator user on a Raspberry Pi is called ‘root’. You can tell Linux that you are an administrator by using the command sudo.
sudo apt update
sudo is short for “superuser do”, or lately, “substitute user do”. It allows you to run commands as another user, and the default is to run the command as the root user. You’ll be asked for your password when you use the sudo command.
Once you run apt update you will see how many packages have an upgrade available. You can see a list of these packages with the command:
apt list --upgradable
To actually upgrade the software on your Raspberry Pi, use the command:
sudo apt full-upgrade
This command will upgrade all the software on your system and remove any packages that are no longer needed. The command will tell you how much disk space the upgrades need; you will need to respond with ‘Y’ to go ahead.
If you want to install a new piece of software on your system using the terminal, you’ll need to know its name. This is often best handled with a quick online search, but you can also do a quick search of APT. For instance, the following will bring up a list of available software that references vector drawing in some way:
apt search vector drawing
In the list you should see an entry for Inkscape that looks something like:
inkscape/stable 0.92.4-3 armhf
vector-based drawing program
You can install Inkscape by typing:
sudo apt install inkscape
If you decide you don’t want a piece of software any more, you can use apt remove:
sudo apt remove inkscape
If you also want to get rid of any configuration files for the software, use apt purge:
sudo apt purge inkscape
Upgrading downloads files to your Raspberry Pi and then installs them in their correct location. After a number of software installs and uninstalls, you might find your SD card is becoming a little full. You can use apt autoclean to remove downloaded files that were used for the installation and are no longer needed:
sudo apt autoclean
Another useful command is apt autoremove; this command will remove software that is no longer needed from your system. For instance, the application imagemagick is required by inkscape. When you remove inkscape from your Raspberry Pi, imagemagick will be left behind; autoremove will take it off your system.
sudo apt autoremove
If you want to find out more about updating and upgrading packages, take a look at the following:
The APT documentation, which covers additional features
Try to search for and install a piece of software from the command line. If you can’t think of anything, you could install a video editing application such as Kdenlive. Share in the comments section what software you found and installed and how you got on.