ThorneLabs

Find the Ubuntu Apt Package a Command Belongs To

• Updated January 10, 2019


While working on Ubuntu Server 14.04, I needed to install the innobackupex command, but simply running sudo 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 did not 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.

sudo apt-get install apt-file

After you have installed apt-file, you need to update its database (just like you would update apt’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 previously mentioned, I needed to install innobackupex, so I ran an apt-file search:

apt-file search innobackupex

apt-file returned one result: percona-xtrabackup.

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