.. title: Search package providing a certain command
.. slug: search-package-providing-a-certain-command
.. date: 2019-04-24 16:10:46 UTC
.. tags: linux, archlinux, debian, centos
.. category: 
.. link: 
.. description: 
.. type: text

I've posted a `short note <https://pdes-net.org/cobra/posts/search-the-package.html>`_ on this topic almost exactly ten years ago, and it's time for an update. The situation: you've heard or read about a certain tool and want to install it, but you can't find it no matter how hard you try. 

My **first** advice: don't search and install via graphical applications. ”Software centers” popular in consumer distributions may not show command line applications at all, so if you've read `my last post <https://cobra.pdes-net.org/posts/calculators.html>`_ and search for dc, you won't find what you are looking for.

**Second:** not every command comes in a package with the same name. For example, in Archlinux, dc is bundled with bc, and it is the latter (much more popular) application which gives the package its name.    

To master such situations, it's time to leave graphical software centers behind and to learn a few basics about the actual package manager underneath. As an example, I'm showing a search for *dig* and *drill*, each of which is contained in a differently named package, with the name of these packages depending (as always) on the distribution.   

Archlinux
"""""""""

::

	pacman -Fs dig
		bind-tools 
	pacman -Fs drill
		ldns 


Debian
""""""

::

	wajig whichpkg /usr/bin/dig
		dnsutils
	wajig whichpkg /usr/bin/drill
		ldnsutils


CentOS/Fedora
"""""""""""""

::

	yum/dnf provides /usr/bin/dig
		bind-utils
	yum/dnf provides /usr/bin/drill
		ldns


OpenSUSE
""""""""
Reportedly, zypper offers `the same functionality <https://unix.stackexchange.com/questions/158041/how-do-i-find-a-package-that-provides-a-given-file-in-opensuse>`_.

Of the `big six <https://pdes-net.org/cobra/posts/genealogy.html>`_, that leaves Gentoo and Slackware. If you use these or a distribution whose package manager is not covered here, while it offers the desired funtionality, send me a note.

**Update:** An attentive reader reminded me of the `Pacman Rosetta <https://wiki.archlinux.org/index.php/Pacman_Rosetta>`_, which includes OpenSUSE and Gentoo. 😎
