Skip to main content
deleted 30 characters in body
Source Link
terdon
  • 252.2k
  • 69
  • 480
  • 718

For the sake of completeness, here'sHere's how to do this for the most common package managers (slightly adapted from here):

  1. Debian and its derivatives

    • Installed packages:

       dpkg -S /path/to/file
      

      or

       dlocate /path/to/file
      
    • All available packages

      Install apt-file and build its database:

        sudo apt-get install apt-file && apt-file update
      

      Then, search for all packages available in the distribution's repositories (installed or not) that provide the file of interest:

        apt-file search /path/to/file
      
  2. Red Hat/Fedora

    • Installed packages:

        rpm -qf /path/to/file
      
    • All available packages:

        yum whatprovides
      
  3. SUSE/openSUSE, all other RPM-based distributions

     rpm -qf /path/to/file
    
  4. Arch

     pacman -Qo /path/to/file
    
  5. Gentoo

     equery belongs /path/to/file
    

For the sake of completeness, here's how to do this for the most common package managers (slightly adapted from here):

  1. Debian and its derivatives

    • Installed packages:

       dpkg -S /path/to/file
      

      or

       dlocate /path/to/file
      
    • All available packages

      Install apt-file and build its database:

        sudo apt-get install apt-file && apt-file update
      

      Then, search for all packages available in the distribution's repositories (installed or not) that provide the file of interest:

        apt-file search /path/to/file
      
  2. Red Hat/Fedora

    • Installed packages:

        rpm -qf /path/to/file
      
    • All available packages:

        yum whatprovides
      
  3. SUSE/openSUSE, all other RPM-based distributions

     rpm -qf /path/to/file
    
  4. Arch

     pacman -Qo /path/to/file
    
  5. Gentoo

     equery belongs /path/to/file
    

Here's how to do this for the most common package managers (slightly adapted from here):

  1. Debian and its derivatives

    • Installed packages:

       dpkg -S /path/to/file
      

      or

       dlocate /path/to/file
      
    • All available packages

      Install apt-file and build its database:

        sudo apt-get install apt-file && apt-file update
      

      Then, search for all packages available in the distribution's repositories (installed or not) that provide the file of interest:

        apt-file search /path/to/file
      
  2. Red Hat/Fedora

    • Installed packages:

        rpm -qf /path/to/file
      
    • All available packages:

        yum whatprovides
      
  3. SUSE/openSUSE, all other RPM-based distributions

     rpm -qf /path/to/file
    
  4. Arch

     pacman -Qo /path/to/file
    
  5. Gentoo

     equery belongs /path/to/file
    
Source Link
terdon
  • 252.2k
  • 69
  • 480
  • 718

For the sake of completeness, here's how to do this for the most common package managers (slightly adapted from here):

  1. Debian and its derivatives

    • Installed packages:

       dpkg -S /path/to/file
      

      or

       dlocate /path/to/file
      
    • All available packages

      Install apt-file and build its database:

        sudo apt-get install apt-file && apt-file update
      

      Then, search for all packages available in the distribution's repositories (installed or not) that provide the file of interest:

        apt-file search /path/to/file
      
  2. Red Hat/Fedora

    • Installed packages:

        rpm -qf /path/to/file
      
    • All available packages:

        yum whatprovides
      
  3. SUSE/openSUSE, all other RPM-based distributions

     rpm -qf /path/to/file
    
  4. Arch

     pacman -Qo /path/to/file
    
  5. Gentoo

     equery belongs /path/to/file