Whether you're performing a security audit, troubleshooting an application conflict, or preparing to migrate your environment, knowing precisely what's installed on your Linux server is a requirement.
The key to this lies in your distribution's package manager, the core utility that handles installing, updating, and removing all software. Because different Linux families use different package managers, the command to list your installed packages will vary.
The most common systems and their tools include:
- APT: For Debian, Ubuntu, and their derivatives.
- DNF / YUM: For AlmaLinux, Rocky Linux, Fedora, CentOS, RHEL, and similar distributions.
- Pacman: For Arch Linux and its derivatives.
- Zypper: For openSUSE.
This guide will show you the exact commands to use for each of these major package managers. Let's dive in.
Listing packages using APT (Debian/Ubuntu)
For Debian-based systems, apt
is your go-to tool. To get a list of all installed packages, open your terminal and run the following command:
sudo apt list --installed
This command will display a lengthy list of all packages currently installed on your system, along with their installed version. The output will be in the format package/distribution [version]
. If you just want the package names without the version or distribution information, you can use dpkg
, the underlying package management tool for Debian systems:
dpkg --get-selections | grep -v deinstall
This command lists all installed packages and their status. The grep -v deinstall
part filters out any packages that are marked for deinstallation but not yet removed.
You might also find aptitude
useful, a more interactive package manager. If you have it installed, you can view a list of installed packages in its interface.
Listing packages using YUM/DNF (AlmaLinux/Rocky Linux/Red Hat/CentOS/Fedora)
On systems using YUM or DNF, the process is equally simple. To list all installed packages using YUM, execute:
yum list installed
Similarly, if your system uses DNF, the command is:
dnf list installed
Both commands will output a table with the package name, version, and repository it came from.
Listing packages using Pacman (Arch Linux)
Arch Linux users will rely on Pacman. To get a list of all explicitly installed packages, use the command:
pacman -Qe
The -Q
flag queries the package database, and -e
specifically filters for explicitly installed packages (as opposed to dependencies). To see all installed packages, including dependencies, simply use:
pacman -Q
Listing packages using Zypper (openSUSE)
For openSUSE systems, Zypper is the command-line package manager. To list all installed packages, run:
zypper se -i
The se
command searches for packages, and the -i
flag limits the results to installed packages.
Filtering and Searching Package Lists
Often, you might not need the entire list of installed packages but rather a subset. All the package managers mentioned above offer ways to filter the results.
For example, with apt
, you can use grep
to filter the output:
sudo apt list --installed | grep "apache2"
This would show only packages with "apache2" in their name. Similar filtering can be applied to the output of yum list installed
, dnf list installed
, pacman -Q
, and zypper se -i
using grep
.
Conclusion
Whether you're using apt
, yum
, dnf
, pacman
, or zypper
, depending on your Linux distribution, the commands we've covered give you a super simple way to list what packages are installed.
Thanks for reading! Keeping your software organized is just one part of maintaining a healthy system. If you're looking for the right infrastructure to run it on, xTom provides a full suite of solutions. From enterprise-grade dedicated servers and flexible colocation to high-performance IP transit and other general IT services, we've got you covered. For smaller projects or scalable virtual servers, check out our shared hosting or the NVMe-powered VPS offerings from our sister brand, V.PS.
Ready to discuss your infrastructure needs? Contact our team to explore the right solution for your projects.
Frequently asked questions about listing packages in Linux
How do I list all installed packages on Ubuntu and Debian?
You can list all installed packages on Ubuntu or other Debian-based systems using the command sudo apt list --installed
.
What is the command to see installed packages on AlmaLinux/Rocky Linux/CentOS/RHEL?
For CentOS, RHEL, or Fedora, you can use either the YUM or DNF package manager. The command is sudo yum list installed
or sudo dnf list installed
.
How can I save the list of installed packages to a file?
You can redirect the output of any list command to a file using the >
operator. For example, on an Ubuntu system, you'd run sudo apt list --installed > installed_packages.txt
. This creates a file named installed_packages.txt
in your current directory with the full list.
How do I check if a specific package is installed?
To check for a specific package, you can pipe the output of the list command to grep
. For example, to see if curl
is installed on a Debian-based system, you would use sudo apt list --installed | grep curl
.