This might work for you. Put this in a script file named apt-version.sh
and make it executable.
#!/bin/bash
TERMS=$@
for name in $(apt-cache search "$TERMS" | sed 's/ .*//'); do
echo "$name "
apt-cache show $name | grep -i -e "description-en" -e "version" | sed 's/^/ /'
done
A test. Put your search terms after the name when you run it.
$ ./apt-version.sh mesa-util
mesa-utils
Version: 8.0.1+git20110129+d8f7d6b-0ubuntu2
Description-en: Miscellaneous Mesa GL utilities
mesa-utils-extra
Version: 8.0.1+git20110129+d8f7d6b-0ubuntu2
Description-en: Miscellaneous Mesa utilies (opengles, egl)
aptitude search
output (where also a very short description of the package is included) – student Jul 06 '12 at 20:09