Find the Ubuntu Apt Package a Command Belongs To

Saturday, October 18, 2014

While working on Ubuntu Server 14.04 I needed to install the innobackupex command. Simply running apt-get install innobackupex did nothing. I tried running apt-cache search innobackupex, but nothing was returned. This was another case of a command belonging to an apt package that didn’t use the same name.

My background is in Enterprise Linux so I’m very used to the yum command. One of the lesser known but very useful yum commands is yum provides. If you are trying to figure out which package a particular command belongs to you can run yum provides */command.

In order to emulate the yum provides functionality in apt you need to install apt-file.

apt-get install apt-file

After you have installed apt-file you need to update its database (just like you would update apt-get’s database):

apt-file update

With that done, you can finally search for the package the command you are trying to install belongs to. As mentioned, I needed to install innobackupex, so I ran an apt-file search:

apt-file search innobackupex

apt-file returned one result which was the package name, percona-xtrabackup.

I installed the package with apt-get install percona-xtrabackup and the innobackupex command was now available.



comments powered by Disqus