| Tested on | Debian 13 (trixie) |
|---|---|
| Applies to | Debian |
| Privilege | sudo or root |
| Scope | List installed packages on Debian , dpkg, dpkg-query, and apt-mark showmanual. |
| Related guides | Add Apt Repository Command Not Found Apt Install Specific Version Backup Brave Browser Session Ubuntu Check Ubuntu Version Configure Vnc Server Ubuntu |
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.
.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
- Debian 11, 12, or 13 with apt and dpkg.
- Terminal access (local or SSH).
- No
sudorequired for read-only listing commands — see sudo command. - Related guides: install Git on Debian, remove unused packages on Ubuntu (same
apt autoremoveconcepts on Debian).
List all .deb packages with apt
On current Debian releases, apt list --installed is the most readable default:
apt list --installedPipe through less when the list is long:
apt list --installed | lessThe first lines on my host:
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) |
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:
dpkg -lHeader and sample rows:
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 - utilitiesFilter installed rows with grep:
dpkg -l | grep '^ii' | grep steamPattern matching:
dpkg-query -l 'steam*'Machine-readable names and versions:
dpkg-query -W -f='${Package}\t${Version}\n' | head -57zip 25.01+dfsg-1~deb13u2
accountsservice 23.13.9-7
acl 2.3.2-2+b1
adduser 3.152
adwaita-icon-theme 48.1-1Search for a specific package
By name with apt
apt list --installed google-chrome-stablegoogle-chrome-stable/now 149.0.7827.200-1 amd64 [installed,local]Glob patterns:
apt list --installed 'linux-image*'Filter the full list
apt list --installed 2>/dev/null | grep -i steamsteam-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
apt show google-chrome-stable
dpkg -s google-chrome-stableapt show includes Installed-Size and APT-Manual-Installed:
Package: google-chrome-stable
Version: 149.0.7827.200-1
Installed-Size: 422 MB
APT-Manual-Installed: yesCount installed packages
Quiet count with apt:
apt -qq list --installed 2>/dev/null | wc -lCount ii rows with dpkg:
dpkg -l | awk '/^ii/ {print $2}' | wc -lBoth returned 2286 on my host.
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):
dpkg --get-selections | grep -w install | wc -lThat returned 2286 on the same system.
List upgradable packages
Refresh metadata, then list packages with a newer version in your configured sources:
sudo apt update
apt list --upgradableCount pending upgrades:
apt -qq list --upgradable 2>/dev/null | wc -lAn 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:
apt-mark showmanualFirst lines on my host:
acl
adduser
apt
apt-listchanges
apt-utils
base-files
base-passwd
bashCount:
apt-mark showmanual | wc -l233That 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:
apt-mark showauto | headProtect a dependency from apt autoremove:
sudo apt-mark manual packagenameList Snap packages
Snaps are not in the apt database. If snapd is installed:
snap listExample output:
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:
snap list | tail -n +2 | wc -lList Flatpak apps
If Flatpak is installed:
flatpak list --appList runtimes and apps together:
flatpak listFlatpak 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:
dpkg-query -f '${binary:Package}\n' -W > ~/packages.txt
head ~/packages.txt7zip
accountsservice
acl
adduser
adwaita-icon-themeManual packages only (migration checklist)
apt-mark showmanual > ~/manual-packages.txt
wc -l ~/manual-packages.txt233 manual-packages.txtCopy to another Debian machine
- Copy
manual-packages.txtto the target system. - Enable the same third-party sources (
google-chrome.sources, Valve Steam repo, etc.). - Install as a checklist:
xargs -a manual-packages.txt sudo apt installExact versions will not match unless releases and mirrors align—treat the file as a shopping list, not a perfect clone.
Human-readable apt export
apt list --installed 2>/dev/null > ~/apt-installed.txtFind the largest installed packages
dpkg-query exposes Installed-Size in kilobytes:
Reverse the ordering with sort -r; the sort command shows descending sorts on the whole line or selected fields.
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn | head -8On my host:
411683 google-chrome-stable
328963 sidra
266558 firefox-esr
236466 locales-all
218823 plexmediaserver
142823 libllvm19Readable megabytes:
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)
grep ' install ' /var/log/dpkg.log | tail -52026-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-1Search rotated logs:
zgrep ' install google-chrome' /var/log/dpkg.log*apt history.log (whole apt sessions)
grep -E '^Commandline:|^Install:' /var/log/apt/history.log | tail -8Shows 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:
dpkg -S /usr/bin/google-chrome-stablegoogle-chrome-stable: /usr/bin/google-chrome-stable/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:
dpkg -L google-chrome-stable | headThe 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
- Debian FAQ — Package management tools
- Debian FAQ — What packages are installed?
- Debian FAQ — Find package for a file
- manpages.debian.org — dpkg-query(1)
- manpages.debian.org — apt-mark(8)
- , ,
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
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.
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.
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.
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.
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.
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.
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.
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.

