Page 38 - Raspberry Pi as a Foundation for Boosting Computer and Technology Literacy
P. 38
3 Fundamentals of the Linux system and terminal usage
Package management
Being a Debian derivative, the Raspberry Pi utilizes apt as its stand-
ard package management tool.
A primary task for users after the installation of a Linux system is
to update it, ensuring security, compatibility, and access to the most
recent software. The update process consists of two straightforward
steps, each requiring elevated privileges. First, execute the following
command:
sudo apt update
In this case, the apt command is executed as an argument of sudo,
which manages user permissions on the system. As a result, the user
must input the superuser password. When typing the password in the
terminal, it might appear as though nothing is being entered, but the
password is simply being hidden for security reasons. After entering
the password, press ‘Enter’. This command synchronizes the versions
of the packages presently installed on the system with those available
in the distribution’s software repository.
At this stage, the user may be interested in knowing which installed
packages are outdated and will be upgraded. To check this, one can run
the following command, which does not require superuser privileges
and, therefore, does not need sudo.
apt list --upgradable
Finally, to upgrade the system, proceed by running the following
command:
sudo apt upgrade
This command will download the new versions of the outdated pack-
ages and install them on the system. It will require elevated privileges
and, therefore, must be run with sudo. When asked, “Do you want to
continue? [Y/n]” type ‘Y’ for yes, or ‘N’ for no, and press ‘Enter’.
It is noteworthy that the aforementioned ‘update’ and ‘upgrade’
commands must both be executed in this exact order to perform a full
system update. Thus, a user might want to use the AND chain operator
(as per the previous section) to combine them:
sudo apt update && sudo apt upgrade
Below are some of the frequently used apt commands for package
management (Table 3.1).
38