Recently I needed
ogg123 on an Ubuntu server to convert some media. Naturally, I wanted to use
aptitude to install it, but I didn't know what package it was in. Now, you can always google of course, but you can also use system commands to find the package you need.
Already Have the File? Use dpkg
If you already have the file, and just want to know which package it belongs to, you can use
dpkg like this:
$ dpkg -S $(which ogg123)
ogg123 with the command you are looking for)
Don't have it yet? Use apt-file
I didn't have the package yet, so dpkg doesn't know about it either.
In this case you can install a nifty little program called
apt-file, which fetch & build a database of all apt packages and their contents, so you can easily find what you need.
Ok, let's install apt-file first.
$ aptitude install apt-file
apt-file works just like
apt, so we need to update it's database before we can use it.
$ apt-file update
Now we're ready to search for our package:
$ apt-file search ogg123
Which in my case returned:
vorbis-tools it is!
$ aptitude install vorbis-tools
You've just got to love the apt.