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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. mkfs.fat: command not found
  2. How to Install Mokutil package on CentOS/RHEL 7 and 8
  3. How to Change or Rename a Mount Point in Linux
  4. ddcutil: command not found
  5. bzfgrep: Find any fixed strings separated by new lines in bzip2 compressed files using fgrep
  6. How to Set Environment Variables for a systemd Service in CentOS/RHEL 7
  7. Beginners Guide to “journalctl” – How To Use Journalctl to View and Manipulate Systemd Logs
  8. swapon: command not found
  9. clamscan: A command-line virus scanner
  10. fdroid: F-Droid build tool

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright