7

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.

2
  • 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. Commented Jul 15, 2022 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. Commented Jul 15, 2022 at 16:21

1 Answer 1

12

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
5
  • 2
    Arch Linux: pkgfile -si info2html Commented Apr 26, 2013 at 4:54
  • apt-file search apt-file :-( --> packages.debian.org/sid/apt-file Commented Jul 23, 2015 at 21:04
  • 1
    Note that recent RedHat/RPM based distros also use sudo dnf whatprovides info2html. Commented Jul 15, 2022 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. Commented Aug 14, 2023 at 11:11
  • 1
    For dnf5 one must leave out the what, i.e. dnf provides executable-name. This also works in older versions. Note that the dnf repoquery [what]provides] command needs a full path, they don't work with just the name. Commented Nov 6, 2024 at 17:02

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.