6

Suppose I want to use the command eg. from the project info2html and it's not available on my system. Some distro's sometimes suggest packages for some missing commands that are expected (ie. considered common), but not for all commands (and not all distros).

How do I find out if there is a package for the desired program in my distribution, and if yes, which package do I need to install? Is there, what is the 'right way' to do this?

Some examples with specific distros like Debian are welcome. :) It may depend on the package management software. Useful terminology is also welcome, so I can find this functionality in a given package ecosystem.

n611x007
  • 1,007
  • 1
    I disagree with this being a duplicate. The previous question asks only about Debian. I came here looking for how to find the containing package on a RedHat machine. The chosen answer answers that wonderfully, and (though it might be in the answers to the "question [that] already has answers", it is not a logical response to the question asked there. – bballdave025 Jul 15 '22 at 16:16
  • I would never have clicked on the link to the other Q&A [ How to find out which (not installed) Debian package a file belongs to?" ], because I wouldn't have thought it would let me know how to complete the task on an RPM-based distro. – bballdave025 Jul 15 '22 at 16:21

1 Answers1

10

Depends on the platform.

Deb based:

apt-file search info2html

RPM based:

yum whatprovides info2html

IPS (Solaris 11, OpenIndiana, OmniOS, etc) based:

pkg search info2html

FreeBSD (OpenBSD?):

cd /usr/ports
make search key=info2html

NetBSD, SmartOS:

pkg_search info2html

Gentoo Linux:

emerge --search info2html
jordanm
  • 42,678
bahamat
  • 39,666
  • 4
  • 75
  • 104
  • 2
    Arch Linux: pkgfile -si info2html – michas Apr 26 '13 at 04:54
  • apt-file search apt-file :-( --> https://packages.debian.org/sid/apt-file – Jan-Philip Gehrcke Jul 23 '15 at 21:04
  • Note that recent RedHat/RPM based distros also use sudo dnf whatprovides info2html. – bballdave025 Jul 15 '22 at 16:19
  • "But how do I find which package provides apt-file, if I don't have apt-file?" On Debian, apt-file is provided by the apt-file package: sudo apt install apt-file. After its installation, its database needs to be initialized once: sudo apt-file update. – Abdull Aug 14 '23 at 11:11