GO KALI FREE
Package Management

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 nginx

Questions 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 -r

Removes an installed package (keeps config files).

snap install

Installs a snap package from the Snap Store.

dpkg -i

Installs a .deb package file directly (does not resolve dependencies).

pip install

Installs Python packages from the Python Package Index (PyPI).

apt list

Lists packages based on package names with options for installed/upgradeable.

apt update

Updates the local package index with the latest information from repositories.