/commands/apt/apt-list-installed
List installed packages with apt and dpkg
The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
- tool
- apt
- versions
- apt 1.0+
- os
- linux
apt list --installed prints every installed package with its version and architecture. To see only the packages you asked for (not the dependencies pulled in automatically), use apt-mark showmanual. For scripts, dpkg-query has a stable, configurable output format.
Common forms
apt list --installed # name/suite,now version arch [installed,…]
apt list --installed 2>/dev/null | grep -i nginx
apt list --upgradable # what apt upgrade would change
apt-mark showmanual # packages installed on purpose
dpkg-query -W -f='${Package}\t${Version}\n' | sort
dpkg -l 'python3*' # with the ii/rc state columnapt prints WARNING: apt does not have a stable CLI interface. Use with caution in scripts. when its output goes to a pipe; that is why the example sends standard error to /dev/null, and why scripts should use dpkg-query.
Save and restore the list
apt-mark showmanual > packages.txt
# on the new machine
xargs -a packages.txt sudo apt-get install -yWhich package owns a file
dpkg -S /usr/bin/curl # curl: /usr/bin/curl
dpkg -L curl # files installed by the packageSources
Related pages
codes · aptdpkg -l status codes: ii, rc, un, iU, iF explainedThe status codes at the start of dpkg -l lines: desired action, then current state. ii means installed, rc removed with config left, iU unpacked, iF failed.compare · aptapt vs apt-get: which one to useapt is the friendlier front end for interactive use, with progress bars, apt list and search; apt-get keeps a stable interface, so scripts should use it.errors · aptapt: E: Unable to locate packageapt install fails with E: Unable to locate package when package lists are outdated, the name is wrong, or the package is in a repository that is not enabled.