dpkg -l Linux Command
Lists all installed packages with version and description.
What does dpkg -l do?
Lists all installed packages with version and description.
Syntax
dpkg -l [pattern]Practical example
dpkg -l | grep nginxQuestions about dpkg -l
How do I list all installed packages?
Use `dpkg -l` to list all installed packages with their version and description. Pipe to grep to filter.
How do I search for a specific package?
Use `dpkg -l | grep package_name` to search for a package in the installed packages list.
How do I see package details with dpkg?
Use `dpkg -s package_name` to show detailed information about an installed package including status and description.
How do I see which package owns a file?
Use `dpkg -S /path/to/file` to find which installed package owns a specific file.
How do I list files installed by a package?
Use `dpkg -L package_name` to list all files installed by that package on your system.
How do I check if a package is installed?
Use `dpkg -l package_name` or `dpkg -s package_name` to check the installation status.
How do I list only configuration files?
Use `dpkg --status package_name | grep Conffiles` to show only the configuration files for a package.
How do I list packages by status?
Use `dpkg -l | grep '^rc'` to find removed packages with config files, or `grep '^ii'` for fully installed packages.
Related Package Management
dpkg -rRemoves an installed package (keeps config files).
snap installInstalls a snap package from the Snap Store.
dpkg -iInstalls a .deb package file directly (does not resolve dependencies).
pip installInstalls Python packages from the Python Package Index (PyPI).
apt listLists packages based on package names with options for installed/upgradeable.
apt updateUpdates the local package index with the latest information from repositories.