From Gentoo Wiki
Jump to:navigation Jump to:search

The page states: use "emerge --ask --depclean gentoo-sources" to remove old kernel sources, reportedly removing "old or unused versions of a slotted package". This is wrong information. "emerge --depclean <atom>" will keep the most recent version of <atom> only if it is a reverse dependency of some other package. In the case of kernel, it is quite common for the kernel to not be a reverse dependency of anything. So the recommended command will offer to unmerge all kernel sources and remove sys-kernel/gentoo-sources from the world file as well. It is not a good idea to do so.

On my home machine, I leave the removal of old kernel sources to regularly running "emerge -ca" (i.e. "--depclean --ask", without any <atom>). That always leaves the last version in the system. I remove the leftovers of old kernels in /usr/src/linux-x.y.z-gentoo manually by simply "rm -r".