3

I read about this Q&A : Show available/installed version in the output of aptitude search. My question is, how do I search by name not by terms? should I change apt-cache search $TERMS to apt-cache search $NAME?

I tried change it but its not working. Hope someone can help me.

2 Answers 2

3

In a terminal run apt-cache policy with the name of the package. This will show you what version you have installed, if any together with what is available in the Ubuntu repositories. For example if on my machine I enter apt-cache policy sudo, the output is:

sudo:
  Installed: 1.8.3p1-1ubuntu3.4
  Candidate: 1.8.3p1-1ubuntu3.4
  Version table:
 *** 1.8.3p1-1ubuntu3.4 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main i386 Packages
        500 http://security.ubuntu.com/ubuntu/ precise-security/main i386 Packages
        100 /var/lib/dpkg/status
     1.8.3p1-1ubuntu3 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise/main i386 Packages

Showing that I have version 1.8.3p1-1ubuntu3.4 installed and this is the latest.

In addition you can use the Ubuntu Packages Search website to see what is available searching by name or description. Though this will not tell you what you have installed.

3
  • Actually it's not the answer I looking for. At previous link at above, it's show how to search available/installed package. I trying to search available package by name not by terms, because its will show any available package by description of the package, not by name. So I trying to get output by name not by terms. Sorry my English is not really good so maybe my question leads to misunderstanding
    – Cloud Leon
    Mar 3, 2013 at 6:50
  • Sorry -- I don't know if there is a way to search within Ubuntu for a partial package name but you can do it online you can search by description or name here: Ubuntu - Ubuntu Packages Search. Added to Answer Mar 3, 2013 at 9:19
  • Thanks for the info, actually I trying to search package for my jailbroken Iphone. But i'm glad that you tried to help me :)
    – Cloud Leon
    Mar 3, 2013 at 9:51
1

try using apt-cache search -n szName (to look for szName) and apt-cache search szName (to look for a term)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .