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