LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-02-2012, 05:07 PM   #1
raindog308
Member
 
Registered: Dec 2010
Posts: 34

Rep: Reputation: 1
When searching for a debian package, how to see version?


When I want to find a package, I usually use "aptitude search <some string>"

Is there a way to see what version is available?

I thought aptitude -v would show this, but it doesn't. On 6.0.3:


Code:
# aptitude search varnish
p   libvarnish-dev                                      - development files for Varnish
p   libvarnish1                                         - shared libraries for Varnish
p   varnish                                             - a state-of-the-art, high-performance HTTP accelerator
# aptitude -v search varnish
p   libvarnish-dev                                      - development files for Varnish
p   libvarnish1                                         - shared libraries for Varnish
p   varnish                                             - a state-of-the-art, high-performance HTTP accelerator
# aptitude -vv search varnish
p   libvarnish-dev                                      - development files for Varnish
p   libvarnish1                                         - shared libraries for Varnish
p   varnish                                             - a state-of-the-art, high-performance HTTP accelerator
 
Old 03-02-2012, 05:16 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
You want the -F option. The aptitude man page actually gives an example of this kind of search. I'll quote it below:

From the -F option itself:
Quote:
Code:
-F <format>, --display-format <format>
    Specify the format which should be used to display output from
    the search and version commands. For instance, passing “%p %V
    %v” for <format> will display a package's name, followed by
    its currently installed version and its available version (see
    the section “Customizing how packages are displayed” in the
    aptitude reference manual for more information).
And from inside the --disable-columns option:
Quote:
Code:
For instance, the first few lines of output from “aptitude search
-F '%p %V' --disable-columns libedataserver” might be:

    disksearch 1.2.1-3
    hp-search-mac 0.1.3
    libbsearch-ruby 1.5-5
    libbsearch-ruby1.8 1.5-5
    libclass-dbi-abstractsearch-perl 0.07-2
    libdbix-fulltextsearch-perl 0.73-10

As in the above example, --disable-columns is often useful in
combination with a custom display format set using the
command-line option -F.
EDIT:
Of course, the example in the --disable-columns uses %V, whereas, if I read your question correctly, you want %v.

EDIT2:
It seems that %V and %v are backaward in the description. By my testing, you actually do want %V.

For instance, varnish is not installed on my system:
Code:
user@localhost$ aptitude search -F '%p %v' --disable-columns varnish
libvarnish-dev <none>                    
libvarnish1 <none>
varnish <none>
user@localhost$ aptitude search -F '%p %V' --disable-columns varnish
libvarnish-dev 2.1.3-8                   
libvarnish1 2.1.3-8
varnish 2.1.3-8

Last edited by Dark_Helmet; 03-02-2012 at 05:29 PM.
 
Old 03-02-2012, 05:18 PM   #3
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,883
Blog Entries: 28

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
apt-cache show varnish
apt-cache policy varnish
apt-show-versions varnish

aptitude versions foo
"aptitude show '<package_name>'" to list detailed description of the package
See Aptitude - Debian Wiki - http://wiki.debian.org/Aptitude
aptitude user's manual - http://algebraicthunk.net/~dburrows/...titude/doc/en/
Chapter*2.*Debian package management - http://www.debian.org/doc/manuals/de...ent_operations
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Searching for package information on Debian and Ubuntu systems LXer Syndicated Linux News 0 10-29-2008 06:20 AM
Package Searching: Which Iso Image? stf92 Linux - Newbie 1 04-13-2008 03:30 AM
Debian package wants an older version of a library Scorper Debian 3 05-14-2006 10:00 PM
"gdesklets" package in Debian: 0.33 or 0.35 version Blue Jacket Linux - Software 7 10-28-2005 04:28 AM
Searching old rpm-4.0-26mdk package zigomatix Mandriva 4 11-21-2004 07:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration