Check package status with apt list --installed
In this step, you'll learn how to check which software packages are installed on your system using the apt list --installed
command.
Linux systems, especially Debian-based ones like Ubuntu (which you are using in this lab), manage software using package managers. apt
is a powerful command-line tool for this purpose.
The apt list
command is used to list packages based on criteria. Adding the --installed
option filters the list to show only packages that are currently installed on your system.
Open your terminal if it's not already open. Remember, you can find the Xfce Terminal icon on the left side of your desktop.
Type the following command and press Enter:
apt list --installed
You will see a long list of packages. This list includes the package name, version, and architecture.
Listing...
accountsservice/jammy-updates,now 0.6.55-0ubuntu12~22.04.5 amd64 [installed]
acl/jammy,now 2.3.1-1 amd64 [installed]
adduser/jammy,jammy,now 3.118ubuntu8 all [installed]
...
zlib1g/jammy-updates,now 1:1.2.11.dfsg-2ubuntu1.6 amd64 [installed]
zsh/jammy-updates,now 5.8.1-1ubuntu1.4 amd64 [installed]
This command is useful for getting a comprehensive overview of the software installed on your system. Because the list can be very long, you might want to scroll up to see the beginning of the output.
To make the output more manageable, you can combine apt list --installed
with other commands using a pipe (|
). For example, to search for a specific package like htop
(which you installed in the previous lab), you can use grep
:
apt list --installed | grep htop
This command takes the output of apt list --installed
and "pipes" it as input to the grep
command, which searches for lines containing "htop".
You should see output similar to this, confirming that htop
is installed:
htop/jammy,now 3.0.5-1build2 amd64 [installed]
Using grep
with apt list --installed
is a quick way to check if a specific package is present on your system.
Click Continue to proceed to the next step.