Thursday 28 January 2010

Listing packages installed from overlays

Gentoo provides an official package repository, and the mechanism for creating third-party repositories, called overlays.  Overlays can be home-made, developer-made, community-made, you name it!

It occurred to me that I wanted to list all installed packages that come from overlays.  (I'm doing some house cleaning, so I'm removing overlays I don't need anymore).  There appears to be no way to generate this list via equery (the "gentoolkit" method of doing various package queries).

This one-liner should do the trick.

$ for i in /var/db/pkg/*/*; do if ! grep gentoo $i/repository >/dev/null; then echo -e "`basename $i`\t`cat $i/repository`"; fi; done

The output of which looks (only slightly messy) like:
revoco-0.5    Orpheus Local Overlay
synce-gvfs-0.3.1    SynCE
synce-serial-9999    SynCE
synce-trayicon-0.14    SynCE
nautilussvn-0.12_beta1-r2    Orpheus Local Overlay
evolution-data-server-2.28.2    Orpheus Local Overlay
gnome-hearts-0.3    Orpheus Local Overlay
nautilus-python-0.5.1    rion
nautilussvn-0.12_beta1_p2    Orpheus Local Overlay
mozilla-thunderbird-bin-3.0_beta2    Orpheus Local Overlay
libgii-1.0.2    Orpheus Local Overlay
grub-0.97-r9    rion
usb-rndis-lite-0.11    SynCE
xorg-server-1.7.4    Orpheus Local Overlay

You can see here that I have various packages installed from the SynCE overlay, the rion overlay and my homespun "Orpheus" overlay.

It assumes your overlay was set up correctly with the file profiles/repo_name containing the overlay name, at the time of install (not available in earlier versions of portage).

7 comments:

transacid said...

if you have eix installed a simple "eix -cI --in-overlay" brings similar results.

scarabeus said...

Out of curiosity why own version of xorg-server?

ph030 said...

`eix -Jc`

Iain said...

Thanks for the eix tips.

scarabeus: long story! I tried disabling nvidia's twinview to use the xorg xinerama (not nvidia's xinerama) but X had instability problems when a secondary screen was placed "Left Of" the main screen. I was trying a patch, but that only made the cursor wrap around back to the same screen. There was a bug somewhere... Bug 291620

In the end I gave up and went back to nvidia!

Anonymous said...

The provided command fails to list packages installed from overlays with "gentoo" in their names (such as the gentoo-haskell overlay). However, you can use egrep:

for i in /var/db/pkg/*/*; do if ! egrep ^gentoo$ $i/repository >/dev/null; then echo -e "`basename $i`\t`cat $i/repository`"; fi; done

This will list any package installed from a repository other than "gentoo" (i.e., the Portage tree).

Anonymous said...

You don't need to use egrep. "^gentoo$" works as well as pattern for grep. :)

demonkoryu said...

Thank you for this tip. Saved me a lot of time :)

 
Copyright 2009 Another Blog. Powered by Blogger Blogger Templates create by Deluxe Templates. WP by Masterplan