Skip to content

/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

bash
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 column

apt 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

bash
apt-mark showmanual > packages.txt
# on the new machine
xargs -a packages.txt sudo apt-get install -y

Which package owns a file

bash
dpkg -S /usr/bin/curl           # curl: /usr/bin/curl
dpkg -L curl                    # files installed by the package

Sources