Package / system tool

dpkg — Debian family

dpkg is used for package management or system administration in the Debian family. Consult the distribution manual for release-specific behaviour.

Availability: Debian and Ubuntu releases; package sources and privileges vary.中文

Syntax

dpkg [options] action

Examples

dpkg is used for package management or system administration in the Debian family. Consult the distribution manual for release-specific behaviour.

dpkg -l 'nginx*'

Show command help and options where supported.

dpkg --help

Parameters, options and clauses

Option / clauseDescription
-i <file.deb>Install a local Debian package file.
-r / -P <package>Remove a package; -P also purges its configuration.
-l [pattern]List installed packages, optionally filtered by a pattern.
-L <package>List files installed by a package.
-S <path>Find the package that owns a file path.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory