The following set of steps is very quick to follow. $ wc -l /var/cache/edb/world 324 $ emerge -i sys-kernel/vanilla-sources-2.4.22 >>> Injected sys-kernel/vanilla-sources-2.4.22. $ emerge -i net-mail/evolution-1.4.4 >>> Injected net-mail/evolution-1.4.4. $ regenworld <snip> add to world: net-mail/evolution add to world: sys-kernel/vanilla-sources $ wc -l /var/cache/edb/world 326 $ emerge -C vanilla-sources evolution >>> Unmerging sys-kernel/vanilla-sources-2.4.22... No package files given... Grabbing a set. >>> Unmerging net-mail/evolution-1.4.4... No package files given... Grabbing a set. $ wc -l /var/cache/edb/world 326 This last number should be 324 as two previously injected packages have been removed. The lesson is that when unmerging injected packages corresponding entries from world file should be removed. You never know when a user may run regenworld. My world file has been building up like this for quite a while and the only way to get a real count is to delete the world file and regenerate. $ emerge info Portage 2.0.49-r2 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.6.0-test4-bk2) ================================================================= System uname: 2.6.0-test4-bk2 i686 Intel(R) Pentium(R) III Mobile CPU 1200MHz distcc 2.10 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.2 [enabled] ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-march=pentium3 -O3 -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-march=pentium3 -O3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="sandbox ccache autoaddcvs buildpkg" GENTOO_MIRRORS="http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/ http://ftp.gentoo.skynet.be/pub/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://gentoo.linux.no/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 oss avi crypt encode foomaticdb gif jpeg mad mmx mpeg ncurses pdflib png quicktime truetype xml2 xmms xv zlib directfb alsa berkdb slang readline aalib bonobo svga tcltk java mysql X sdl gpm tcpd pam libwww ssl perl python imlib oggvorbis gtk motif opengl mozilla cdr acpi acpi4linux apache2 dvd faad fax fbcon fbdev gd gmtsuppl imagemagick imap kerberos lcd maildir md5sum nptl offensive openal parse-clocks pcmcia php pnp ppds S3TC sse tiff transcode usb xml xosd -apm -arts -cups -kde -gnome -libg++ -mikmod -nls -qt -spell -gtkhtml -gdbm -guile -esd"
An alternative solution to this problem is that the regenworld script can be modified to detect injected packages in /var/db/pkg and to not add them to the world file in the first place. Perhaps this would be a cleaner solution.
I noticed in my system that I installed all 2.6.x kernel (did 2.6.5 this weekend) and in /var/db/pkg/sys-kernel/development-sources-2.6.5 there is only a file called COUNTER. I think it should contain a file that describes it privides alsa, gentoo-sources, etc so it stops asking to emerge alsa-libs or gentoo-sources everytime it finds a dependency with this package.
I forgot to mention I installed manually and used inject to tell this to the system.
virtuals are handled in /var/cache/edb/virtuals not in /var/db/pkg/
--inject has been deprecated.