Ubuntu equivalent to rpm -qf /path/and/file

Written by James McDonald

May 6, 2009

In RPM based distros you can issue the command

rpm -qf /usr/bin/dig

and it will return the installation package name

I don’t know if this is the ‘proper’ way to do it but it works:

dpkg-query -S dig | grep /usr/bin/dig
dnsutils: /usr/bin/dig

1 Comment

  1. Kyle Huff

    Just found your page, and I am enjoying it so far.. Just wanted to note, using dpkg, you can specify the path to the file to find the package that provides it;

    $ dpkg -S /usr/bin/dig
    dnsutils: /usr/bin/dig


    $ dpkg -S `which dig`
    dnsutils: /usr/bin/dig

    Same results, just a little less to type.


Submit a Comment

Your email address will not be published. Required fields are marked *

You May Also Like…

Docker on Fedora 32

Docker on Fedora 32

Commands to run to get moby-engine running on Fedora 32 # as root or sudo'd dnf install grubby grubby...

PDF Poster

PDF Poster

Start with a wide long image. This is just a screen shot of my desktop. widescreen.png Convert it to postscript using...