• 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-query: command not found

by Deepika

dpkg-query is a command-line tool in Linux used to query information about installed packages on a Debian-based system. It is part of the dpkg package management system, which is the default package management system for Debian and its derivatives, such as Ubuntu.

The dpkg-query command can be used to perform a variety of tasks related to installed packages, including:

  • Listing all installed packages on the system.
  • Checking the status of a specific package.
  • Displaying information about a specific package such as version and description.
  • Searching for a package by name or by other attributes.

If you encounter the below error while running the command dpkg-query:

dpkg-query: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install dpkg
Ubuntu apt-get install dpkg
Alpine apk add dpkg
Kali Linux apt-get install dpkg
Fedora dnf install dpkg
OS X brew install dpkg
Raspbian apt-get install dpkg

dpkg-query Command Examples

1. List all installed packages:

# dpkg-query --list

2. List installed packages matching a pattern:

# dpkg-query --list 'libc6*'

3. List all files installed by a package:

# dpkg-query --listfiles libc6

4. Show information about a package:

# dpkg-query --status libc6

5. Search for packages that own files matching a pattern:

# dpkg-query --search /etc/ld.so.conf.d

Filed Under: Linux

Some more articles you might also be interested in …

  1. usermod Command Examples in Linux
  2. How to extract RAR files in CentOS/RHEL 7 and 8
  3. halt Command Examples in Linux
  4. vncviewer Command Examples in Linux
  5. chsh: command not found
  6. gdal_contour: Create contour lines and polygons from a digital elevation model
  7. How to Migrate CentOS/RHEL 6 iptables Rules to CentOS/RHEL 7 firewalld
  8. sm Command Examples in Linux
  9. CentOS / RHEL : How to install and start the Apache httpd service
  10. What is the purpose of .bash_profile file under User Home Directory In Linux

You May Also Like

Primary Sidebar

Recent Posts

  • gml2gv Command Examples
  • glow Command Examples
  • glib-compile-resources Command Examples
  • glances Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright