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

    or

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

    Same results, just a little less to type.

    Reply

Submit a Comment

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…