• 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-query Command Examples in Linux

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.

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. dconf : command not found
  2. emerge Command Examples in Gentoo Linux
  3. insmod: command not found
  4. pkill Command Examples in Linux
  5. CentOS / RHEL 6 : Lock User Account After N Number of Incorrect Login Attempts
  6. du: command not found
  7. How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  8. Linux OS Service ‘cups’
  9. How to enable SFTP Logging without chroot in CentOS/RHEL
  10. Example of using getnstimeofday in Linux kernel

You May Also Like

Primary Sidebar

Recent Posts

  • fprintd-delete Command Examples in Linux
  • fprintd-delete: command not found
  • foreman: command not found
  • foreman Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright