Blog

Listing Installed Packages on Linux, by Package Manager

The right way to list installed packages on Linux depends on which package manager your distribution uses, not the distro itself. A post by joshtlectic.com breaks down the commands by manager, and that framing scales: learn five managers, not fifty distros.

Key facts

Package Manager Distributions Command
pacman Arch Linux, Manjaro, Antergos `pacman -Q`
dpkg / apt Debian, Ubuntu, MX Linux, Mint, elementary `dpkg -l`
yum / dnf Fedora, CentOS, Red Hat Enterprise Linux `rpm -qa`
zypper openSUSE, Tumbleweed `zypper search -is`
pkgtools / slackpkg Slackware `ls /var/log/packages/`

The commands, by package manager

Arch and its derivatives use pacman. The full list of installed packages comes from `pacman -Q`. The same flag works through AUR wrappers such as yay, pacaur, pikaur, and yay, so the command does not change.

Debian-based distros use apt or dpkg. The query flag is `dpkg -l`, which prints a table of installed packages with version numbers and descriptions. Apt is largely a front end over dpkg, so either tool produces the same list.

Red Hat-family distros use yum or dnf depending on the release. The query flag `rpm -qa` dumps the raw list, while `yum list installed` or `dnf list installed` provides a higher-level view. Both query the same underlying rpm database.

OpenSUSE and Tumbleweed use zypper. The flag `zypper search -is` lists installed packages with their repositories.

Slackware, where the reference author first learned Linux, uses pkgtools and slackpkg. Packages are listed as files under `/var/log/packages/`, and `ls` of that directory shows the full inventory.

Our analysis

The package-manager framing works because managers change less frequently than distributions. Five managers cover most systems you will encounter.

The trade-off is between complete lists and useful lists. A raw dump includes every library and dependency—hundreds or thousands of items you never consciously installed. Wrapper tools offer flags to filter down to explicitly installed packages. Knowing which flag to use turns an overwhelming list into something actionable for system audits or migrations.

Your use case determines which command to run. Migrating to new hardware? You need only the packages you chose, not the dependency tree. Auditing for vulnerabilities? You need the complete list with versions. The commands are short; the difference is knowing which question you are asking.

What to watch

Flatpak, Snap, and AppImage install software outside the traditional package managers. None of the five commands above see these packages. If your workflow includes them, add `flatpak list` and `snap list` to your audit script, or you will miss a growing portion of installed software.

Key takeaways

  • `pacman -Q` on Arch, `dpkg -l` on Debian, `rpm -qa` on Red Hat, `zypper search -is` on SUSE, `ls /var/log/packages/` on Slackware.
  • Learn wrapper flags to filter dependency noise when you need an actionable package list.
  • Flatpak and Snap maintain separate databases and require their own list commands.

Frequently asked questions

What is the quickest command to list installed packages on Ubuntu?

`dpkg -l` gives a table of every package with versions and descriptions.

How do I export only the packages I installed myself on Arch?

Run `pacman -Q` and pipe it to a file. Combine with additional tools if you need to separate explicitly installed packages from dependencies.

Why does `rpm -qa` give the same result as `dnf list installed`?

Both tools query the same underlying rpm database. The difference is formatting and extra metadata that dnf adds.

Will these commands list Flatpak or Snap apps?

No. Flatpak and Snap maintain their own databases. Use `flatpak list` and `snap list` for those.

Related