How to find which package provides a command in yum

CentOS-LogoSometimes you know you need a package, but when you try to install it with yum you’ll get a message like “No matches found”. Yet you’re sure the package exists because you’ve used it before.

This can happen if the package in question is part of a set which installs multiple packages. The net-tools package springs to mind.

yum has a great option called whatprovides with which you can query what package you need to install to use a command. Let’s try it out!

Say I wanted to install mkfs.vfat which is not installed by default in CentOS. Simply trying to install it won’t work:

Of course it won’t. But I can ask yum what provides this package:

Well fantastic! The package I’m looking for is called dosfstools. Knowing that, I can simply use yum install dosfstools, and a few moments later mkfs.vfat will work as expected.

Thanks, yum!

Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.

Add your voice!