System Administration Practice
Keep Portage Tree Up-To-Date
Even if you're not doing a full update every day, you should sync the portage tree and overlays regularly. It will reduce the time that you need to sync tree before a system upgrade. Also, if you just want to install something, it will be installed with latest deps so you will not waste time on upgrading it later. Here is an example script to upgrade portage and overlay every day. Edit
/etc/cron.daily/autosync.sh with your favorite text editor:
Purge unused distfiles
Distfiles may take up a lot of space on disk, and if you do not clean them from time to time it may become an issue. There are many ways to clean them.
- Remove distfiles which wasn't accessed in last 90 days. (WARNING: It will not work if distfiles are on filesystem with noatime option. You may want think about relatime).
Alternative is using eclean purge utility for distfiles and binary packages, it is part of app-portage/gentoolkit package. Let's say we want to purge distfiles in /usr/portage/distfiles
# eclean-dist -i
This command will prompt for each distfile and ask user's confirmation (can be slow). Example of advanced usage, let's clean all distfiles except for installed packages (exact version), those which are less than one month old, bigger than 50MB, or fetch-restricted:
# eclean-dist -d -t1m -s50M -f
Cron lovers :) clean packages in the safest mode, and then distfiles in deep mode but protecting files less than a week old, every sunday at 1am:
# 0 1 * * sun eclean -C -q packages ; eclean -C -q -d -t1w distfiles