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 ':'
Thanks but the problem with this is I'd have to trawl through the entire package lists for my chosen repositories. Perhaps a better way to visualize the problem would be thus: imagine X being the universal set of all packages in the Debian package repositories my server is pointed to and Y being the set of packages I have installed on said server; what, in essence, I seek is X - Y. Now, I realize I can do this programmatically but I'd hoped there would be a relatively simple command to achieve the same result on a Debian system. – freakwincy – 2012-04-03T20:45:01.460
Just saw your edited answer. Its exactly what I was looking for! Thanks. – freakwincy – 2012-04-04T10:33:00.570
P.S. I'd have up-voted your answer but I haven't accumulated enough reputation points yet. – freakwincy – 2012-04-04T10:36:20.190
No problem. Welcome to SU by the way ;-) – ℝaphink – 2012-04-04T10:37:06.667