• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

dpkg Command Examples in Linux

by admin

The dpkg command is used to manage packages on Debian-derived distributions. Until recently, the most important of the Debian packaging tools and still the primary package management program. Used to install or uninstall packages or as a frontend to dpkg-deb. It includes many different options, some of which are described in the following table.

Option Description
-i {package name} Install the package.
-r {package name} Remove (uninstall) the package.
-l [package name] List information about the specified package; if none provided, list all installed packages.
-s [package name] Report whether the package is installed.

dpkg Command Examples

1. Install a package:

# dpkg -i path/to/file.deb

2. Remove a package:

# dpkg -r package_name

3. List installed packages:

# dpkg -l pattern

4. List a package’s contents:

# dpkg -L package_name

5. List contents of a local package file:

# dpkg -c path/to/file.deb

6. Find out which package owns a file:

# dpkg -S filename

7. Remove a package (does not remove configuration files):

# dpkg -r packagename

8. Remove a package and its configuration files:

# dpkg --purge packagename

Conclusion

To use the dpkg program, you must have the .deb software package available on your system. Often you can find .deb versions of application packages ready for distribution on the application website. Also, most distributions maintain a central location for packages to download.

Filed Under: Linux

Some more articles you might also be interested in …

  1. nmcli device Command Examples in Linux
  2. nmon Command Examples in Linux
  3. btrbk Command Examples in Linux
  4. lvdisplay error: “Failed to create directory /var/lock/lvm. File-based locking initilisation failed.”
  5. etckeeper: command not found
  6. Understanding How an Email System Works
  7. dig Command Examples in Linux
  8. zip Command Examples in Linux
  9. “-bash: route: command not found” on CentOS/RHEL 8
  10. bpftool Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright