How to List Installed Packages on Debian

List installed packages on Debian with apt list --installed, dpkg -l, dpkg-query, and apt-mark showmanual. Search one package, count totals, list Snap and Flatpak apps, export names for another machine, and read apt or dpkg install logs.

Published

Updated

Read time 8 min read

Reviewed byDeepak Prasad

List installed packages on Debian hero with DEBIAN GUIDE badge, apt list command graphics, and package inventory highlights

Debian tracks most software as .deb packages managed by APT and dpkg. When you audit a server, clone a workstation, or track down a dependency, you usually need one of three things: the full package list, a lookup for one name, or a count or export you can reuse elsewhere.

This guide is organized by what you want to find on Debian 11 (Bullseye), 12 (Bookworm), and 13 (Trixie). I ran every command on Debian 13 and kept real terminal output below. For Ubuntu-specific naming, see list installed packages on Ubuntu.

Tested on: Debian 13 (trixie); kernel 6.12.94+deb13-amd64; amd64.

NOTE
apt and dpkg list .deb packages only. Snap and Flatpak apps use separate commands. A complete inventory on a typical desktop combines all three when those installers are present.

What do you want to find?

Goal Command or section
Full list of installed .deb packages apt list --installed
Classic table with status codes dpkg -l
Check one package by name Search a specific package
How many packages are installed Count installed packages
Packages with updates waiting List upgradable packages
Packages you chose yourself Manually installed packages
Snap applications List Snap packages
Flatpak applications List Flatpak apps
Save names to a file Export the package list
Largest packages by disk use Packages by installed size
When something was installed Install history from logs
Which package owns a file Reverse lookup with dpkg -S

Prerequisites


List all .deb packages with apt

On current Debian releases, apt list --installed is the most readable default:

bash
apt list --installed

Pipe through less when the list is long:

bash
apt list --installed | less

The first lines on my host:

text
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Listing...
7zip/stable,now 25.01+dfsg-1~deb13u2 amd64 [installed,automatic]
accountsservice/stable,now 23.13.9-7 amd64 [installed,automatic]
acl/stable,now 2.3.2-2+b1 amd64 [installed]
adduser/stable,stable,now 3.152 all [installed]

Common tags in the last column:

Tag Meaning
[installed] You (or an explicit apt install) chose this package
[installed,automatic] Installed as a dependency
[installed,local] Installed from a local .deb (for example Google Chrome)
HINT
The WARNING about an unstable CLI is normal when you pipe apt. For scripts, prefer dpkg-query—the Debian FAQ on package tools documents dpkg --list as the low-level equivalent.

List packages with dpkg -l

dpkg -l prints the dpkg database directly. The Debian FAQ documents this as the standard way to learn what is installed. Every row starts with a two-letter status code; ii means installed and configured:

bash
dpkg -l

Header and sample rows:

text
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                 Version          Architecture Description
+++-====================-================-============-=================================
ii  google-chrome-stable 149.0.7827.200-1 amd64        The web browser from Google
ii  acl                  2.3.2-2+b1       amd64        access control list - utilities

Filter installed rows with grep:

bash
dpkg -l | grep '^ii' | grep steam

Pattern matching:

bash
dpkg-query -l 'steam*'

Machine-readable names and versions:

bash
dpkg-query -W -f='${Package}\t${Version}\n' | head -5
text
7zip	25.01+dfsg-1~deb13u2
accountsservice	23.13.9-7
acl	2.3.2-2+b1
adduser	3.152
adwaita-icon-theme	48.1-1

Search for a specific package

By name with apt

bash
apt list --installed google-chrome-stable
text
google-chrome-stable/now 149.0.7827.200-1 amd64 [installed,local]

Glob patterns:

bash
apt list --installed 'linux-image*'

Filter the full list

bash
apt list --installed 2>/dev/null | grep -i steam
text
steam-devices/stable,stable,now 1:1.0.0.83~ds-3 all [installed]
steam-libs/stable,now 1:1.0.0.83~ds-3 amd64 [installed,auto-removable]

Detailed metadata

bash
apt show google-chrome-stable
dpkg -s google-chrome-stable

apt show includes Installed-Size and APT-Manual-Installed:

text
Package: google-chrome-stable
Version: 149.0.7827.200-1
Installed-Size: 422 MB
APT-Manual-Installed: yes

Count installed packages

Quiet count with apt:

bash
apt -qq list --installed 2>/dev/null | wc -l

Count ii rows with dpkg:

bash
dpkg -l | awk '/^ii/ {print $2}' | wc -l

Both returned 2286 on my host.

NOTE
dpkg-query -W | wc -l returned 2288 because it also includes 2 packages in rc state (removed but configuration files left). For installed binaries only, filter ^ii or use apt list --installed.

Legacy selection count (still works):

bash
dpkg --get-selections | grep -w install | wc -l

That returned 2286 on the same system.


List upgradable packages

Refresh metadata, then list packages with a newer version in your configured sources:

bash
sudo apt update
apt list --upgradable

Count pending upgrades:

bash
apt -qq list --upgradable 2>/dev/null | wc -l

An empty list right after sudo apt upgrade is normal.


List manually installed packages

APT records whether you explicitly installed a package or it arrived only as a dependency.

List manual packages:

bash
apt-mark showmanual

First lines on my host:

text
acl
adduser
apt
apt-listchanges
apt-utils
base-files
base-passwd
bash

Count:

bash
apt-mark showmanual | wc -l
text
233

That is 233 manual packages versus 2286 total—most entries are automatic dependencies pulled in by tools like Node.js or Steam.

List automatic-only packages:

bash
apt-mark showauto | head

Protect a dependency from apt autoremove:

bash
sudo apt-mark manual packagename

List Snap packages

Snaps are not in the apt database. If snapd is installed:

bash
snap list

Example output:

text
Name    Version   Rev  Tracking       Publisher
bare    1.0       5    latest/stable  canonical**
core24  20260410  1643 latest/stable  canonical**
snapd   2.68.3    …    latest/stable  canonical**

Count application snaps (excluding base snaps) with your own filter, or count all rows minus the header:

bash
snap list | tail -n +2 | wc -l

List Flatpak apps

If Flatpak is installed:

bash
flatpak list --app

List runtimes and apps together:

bash
flatpak list

Flatpak software does not appear in apt list --installed or dpkg -l.


Export the package list to a file

All installed package names

Save one name per line:

bash
dpkg-query -f '${binary:Package}\n' -W > ~/packages.txt
head ~/packages.txt
text
7zip
accountsservice
acl
adduser
adwaita-icon-theme

Manual packages only (migration checklist)

bash
apt-mark showmanual > ~/manual-packages.txt
wc -l ~/manual-packages.txt
text
233 manual-packages.txt

Copy to another Debian machine

  1. Copy manual-packages.txt to the target system.
  2. Enable the same third-party sources (google-chrome.sources, Valve Steam repo, etc.).
  3. Install as a checklist:
bash
xargs -a manual-packages.txt sudo apt install

Exact versions will not match unless releases and mirrors align—treat the file as a shopping list, not a perfect clone.

Human-readable apt export

bash
apt list --installed 2>/dev/null > ~/apt-installed.txt

Find the largest installed packages

dpkg-query exposes Installed-Size in kilobytes:

bash
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn | head -8

On my host:

text
411683	google-chrome-stable
328963	sidra
266558	firefox-esr
236466	locales-all
218823	plexmediaserver
142823	libllvm19

Readable megabytes:

bash
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn | head -8 | \
  awk '{printf "%s\t%.1f MB\n", $2, $1/1024}'

Package install history from logs

dpkg.log (per-package timestamps)

bash
grep ' install ' /var/log/dpkg.log | tail -5
text
2026-06-29 05:18:06 install flatpak:amd64 <none> 1.16.6-1~deb13u1
2026-06-29 05:19:36 install steam-devices:all <none> 1:1.0.0.83~ds-3
2026-06-29 05:23:05 install google-chrome-stable:amd64 <none> 149.0.7827.200-1

Search rotated logs:

bash
zgrep ' install google-chrome' /var/log/dpkg.log*

apt history.log (whole apt sessions)

bash
grep -E '^Commandline:|^Install:' /var/log/apt/history.log | tail -8

Shows commands like apt install -y ./steam_latest.deb with package names installed in that session.

Logs rotate and do not record packages from the initial Debian installer image.


Find which package owns a file

When you find a binary on disk and need the owning package:

bash
dpkg -S /usr/bin/google-chrome-stable
text
google-chrome-stable: /usr/bin/google-chrome-stable
HINT
Symlinks such as /usr/bin/google-chrome may not resolve with dpkg -S. Point at the real binary path or run readlink -f /usr/bin/google-chrome first.

List files shipped by one package:

bash
dpkg -L google-chrome-stable | head

The Debian FAQ also describes apt-file search when the file comes from a package not currently installed.


Troubleshooting

Symptom Likely cause Fix
WARNING: apt does not have a stable CLI Normal when piping apt Use dpkg-query in scripts or redirect stderr
Package missing from apt list but file exists Snap, Flatpak, or manual binary Run snap list, flatpak list, or dpkg -S /path
dpkg-query -W count higher than ^ii rc config leftovers sudo apt purge packagename or ignore rc rows
apt-mark showmanual seems too large Metapackages and admin tools marked manual Cross-check with apt history.log
Empty apt list --upgradable after update System already current Expected after sudo apt upgrade

References


Summary

List installed packages on Debian with apt list --installed for a readable inventory, dpkg -l for the classic status table, and apt-mark showmanual when you only want packages you explicitly installed. Count with apt -qq list --installed 2>/dev/null | wc -l or dpkg -l | grep -c '^ii'—both returned 2286 here. Add snap list and flatpak list for non-apt software, export apt-mark showmanual when rebuilding another machine, and use dpkg -S or /var/log/dpkg.log when you need file ownership or install dates.


Frequently Asked Questions

1. What is the best command to list installed packages on Debian?

For readable output on Debian 11 and newer, run apt list --installed. For scripting or a classic table with descriptions, use dpkg -l and filter lines starting with ii. Both cover .deb packages from apt; neither lists Snap or Flatpak apps.

2. What is the difference between apt list and dpkg -l on Debian?

apt list --installed shows repository tags like [installed] or [installed,automatic]. dpkg -l reads the dpkg database directly with two-letter status codes—ii means fully installed. dpkg is lower level; apt adds suite and manual/automatic hints.

3. Does apt list --installed include Snap packages on Debian?

No. Snap packages are managed by snapd separately. Run snap list for Snaps and flatpak list for Flatpak apps. A full desktop inventory usually combines apt list --installed, snap list, and flatpak list when those tools are installed.

4. How do I list only packages I installed manually on Debian?

Run apt-mark showmanual. That prints packages APT recorded as manually installed—not pulled in only as dependencies. Use apt-mark showauto for automatic dependency packages.

5. How do I count installed packages on Debian?

Run apt -qq list --installed 2>/dev/null | wc -l or dpkg -l | grep -c "^ii". On Debian 13 both returned 2286. dpkg-query -W may count slightly higher if rc leftover-config packages remain.

6. How do I export my Debian package list for another machine?

Save names with dpkg-query -f "${binary:Package}\n" -W > packages.txt, or apt-mark showmanual > manual.txt for packages you explicitly chose. On the target Debian system with matching release and repos, use xargs -a manual.txt sudo apt install as a checklist—not a byte-for-byte clone.

7. How do I find which package owns a file on Debian?

Run dpkg -S /path/to/file—for example dpkg -S /usr/bin/google-chrome-stable returns google-chrome-stable. For files not yet installed from a known package, install apt-file and run apt-file search filename.

8. How do I see when a package was installed on Debian?

Search /var/log/dpkg.log with grep install packagename. Recent apt sessions also appear in /var/log/apt/history.log with timestamps. Logs rotate and do not include packages from the initial installer image.
Omer Cakmak

Linux Administrator

Highly skilled at managing Debian, Ubuntu, CentOS, Oracle Linux, and Red Hat servers. Proficient in bash scripting, Ansible, and AWX central server management, he handles server operations on …