» Search for a package with apt-file
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)
(replace 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.
Installing apt-file
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
Search
Now we're ready to search for our package:
apt-file search ogg123
Which in my case returned:
irssi-scripts: /usr/share/irssi/scripts/ogg123.pl
python-pyvorbis: /usr/share/doc/python-pyvorbis/examples/ogg123.py
vorbis-tools: /usr/bin/ogg123
vorbis-tools: /usr/share/doc/vorbis-tools/examples/ogg123rc-example
vorbis-tools: /usr/share/man/man1/ogg123.1.gz
Very well, vorbis-tools it is!
aptitude install vorbis-tools
You've just got to love the apt.
Stay up to date
You can track my blog
articles and
comments. You may also find my
bookmarks interesting. Or
Follow me on Twitter
Like this article?
|
Then Digg it! Or use another bookmark button below to show your support & help me spread the word. |
RelatedArticles like this one» Customize a fresh Ubuntu Desktop |
tags: ubuntu, apt, dpkg, aptfile
category: Howto - System
read: 3,426 times






tagcloud
#4. Kevin on 21 February 2010
#3. Dejan Ranisavljevic on 26 January 2010
#2. Kevin on 10 November 2008
It won't find anything because it cannot search the packages' files. Hence you will only get results when you already know the package name vorbis-tools or some part of the description.
#1. Robin on 10 November 2008
One question though, in which respect is `apt-file search` different than `apt-cache search`? Other than the fact apt-cache is already part of the aptitude package?