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 with yum based Linux distributions, so I’m familiar enough with the yum command to know that yum provides */command can be used to quickly figure out what package a command belongs to.

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