20 Aug, 2009
How-To: Cleaning up Gentoo to get more free disk space
Posted by: Fritz Thomas In: Linux|Overall
You can safely empty some directory`s in Gentoo. But as always – first make sure if my suggestions are OK for YOU too!
# As superuser gentoo ~ # emerge --sync gentoo ~ # emerge -av gentoolkit gentoo ~ # emerge -av --newuse --deep --update world gentoo ~ # emerge -av --depclean gentoo ~ # revdep-rebuild gentoo ~ # rm -rf /var/tmp/portage/* gentoo ~ # rm -rf /var/tmp/ccache/* gentoo ~ # rm -rf /var/tmp/binpkgs/* gentoo ~ # rm -rf /var/tmp/genkernel/* gentoo ~ # rm -rf /usr/portage/distfiles/* gentoo ~ # rm -rf /tmp/*
First, you have to install gentoolkit if you haven done this already. Then we remerge or update all packages where USE flags have changed. Then we are searching for unneeded dependencies and remove them. Finally we check if there are any packages with unresolved link dependencies, let them emerge and then clean up some directories.
Optionally you can defrag some of your partitions if this is neccessary. In case of XFS you can do this by:
gentoo ~ # xfs_db -r /dev/hda2After this you should have a cleaned up gentoo environment, with no broken dependencies and no unneeded packages or libraries.