How to install a concrete binary in a rpm distro

How to install a concrete binary in a rpm based distribution? Let’s asume you have a rpm based distro. I will wrote this little howto using a CentOS 7.8.

For instance you need to install iwlist but you don’t know what package provides you that binary. You have to type:

# yum provides iwlist

Your local database will return you something like this:

[pbenavent@localhost ~]$ yum provides iwlist
Complementos cargados:fastestmirror
Determining fastest mirrors
* base:
* epel:
* extras:
* updates:
1:wireless-tools-29-13.el7.x86_64 : Wireless ethernet configuration tools
Repositorio : @epel
Resultado obtenido desde:
Nombre del archivo : /usr/sbin/iwlist

Now you know the package name that you need to install, so the only thing you need to do is installed:

# yum install wireless-tools

As you may notice by reading the above lines, it’s assumed that your repository have indexed in its information the binary and package you’re querying for. In this particular exemple, the binary was iwlist and in the answer you read the full path indexed (/usr/bin/iwlist) wich is provided by EPEL repos. Remember the EPEL repo it’s not installed by defaul.