Skip to content


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

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
Bookmark and Share

Posted in GNU/Linux.


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Kyle Huff says

    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

    or

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

    Same results, just a little less to type.



Some HTML is OK

or, reply to this post via trackback.