grep-dctrl
and its derivatives provide a great way to query the apt cache files. (You can install these tools on ubuntu with
sudo apt-get install dctrl-tools
)
In the case of available (but not necessarily installed) packages, you can use grep-available
. For example, to list all available packages:
grep-available -s Package .
Edit:
aptitude
can show you a list of Not Installed Packages by just launching it.
You can also get a list of not installed packages with aptitude
by using:
aptitude -F "%p" search "?not(?installed)"
Note that with the new multi-arch packages, you'll get packages for other architectures listed in this result. For example, I get:
aptitude -F "%p" search "?not(?installed)" | grep "^bash:"
bash:i386
I have the bash
package installed, but it's the amd64 version, since my OS is installed with the amd64 version of Ubuntu Precise. If you don't want to see these packages for other architectures, you can exclude lines containing :
:
aptitude -F "%p" search "?not(?installed)" | grep -v ':'