« Bar Graphs with MySQL | Main | A Trip to the New England Aquarium »
November 26, 2006
Searching for apt-get Packages on Ubuntu Linux
I've been needing this for some time; the ability to search for apt-get packages on Ubuntu when I don't know the name of the package. Turns out there's a corresponding utility for doing this:
shell> apt-cache search <search string>
You'll want to be sure your repository is up to date with apt-get update. Today I need DBI to get Perl connected to MySQL, but can't figure out what the apt-get package name is (I tried "DBI", "perl-DBI", "DBI-perl"). A search immediately gives me what I need:
shell> apt-cache search dbi
libdbd-mysql-perl - A Perl5 database interface to the MySQL database
libdbi-perl - Perl5 database interface by Tim Bunce
libxml-sax-perl - Perl module for using and building Perl SAX2 XML processors
And find that apt-get install libdbi-perl gets me right back on the road.
Ubuntu (in this case the apt utilities) just makes things so easy.
Posted by mike at November 26, 2006 8:24 AM
Hard Drive Recovery Group offers hard disk data recovery services for RAID, laptops and servers. Complete clean room and hard drive repair service.Trackback Pings
TrackBack URL for this entry:
http://mike.kruckenberg.com/mt/mt-tb.cgi/958
Comments
If you can't be bothered to try and remember which of apt-get, dpkg, apt-cache to use for a given operation on the installed packages, you can also use aptitude, which is included in ubuntu proper (also included in debian). If you have universe/multiverse in your sources.list as well, you could also give wajig a whirl, which has a '-t' switch for training which shows you what wajig is wrapping around for different stuff.
Posted by: Harald Wagener at November 26, 2006 11:34 AM
This convenience isn't unique to apt, of course; Portage has 'emerge --search', etc.
Posted by: Toby at November 26, 2006 11:39 AM
Toby - Gentoo, portage, and emerge -s were what made not knowing how to search in the apt utilities annoying. I gad gotten used to that functionality in Gentoo and hoped there was something similar when using Ubuntu.
Posted by: Mike at November 26, 2006 2:24 PM
Thank you so much. I was pretty frustrated with apt-get, compared to emerge, until now.
Posted by: m1k3 at May 29, 2007 6:13 AM
Thanks Mike, saved my bacon.
Google search of apt-get perl-DBI had you listed first.
Regards
Ronald
Posted by: Ronald Bradford at January 3, 2008 12:09 PM