List of repetitive tasks

Make sure the system has the right time, since compiling and linking depends on the date and time of the files: Type date

If the time is set wrong, then sooner or later problems occur with no obvious reason. Checkout the time chapter. Many of the following tasks are supported by the program genservice. See:

Keep computer updated

  1. Before doing the big compilation work, check if you are using newest gcc compiler gcc-config -l and that a gcc profile is selected.

  2. emerge --sync

  3. /etc/make.profile does it point to the newest profile? (read gentoo upgrade guide for updating it). /usr/portage/profiles is where the profiles are. Where:

    eselect profile list shows all profiles available and

    eselect profile set <number>lets change (update) to an other profile

  4. emerge --update --deep world --pretend to see if you have blockages

  5. Check for comments and follow them as emerge -u portage

  6. emerge --update --deep world after that it is wise to read all the warnings and info that it is summarized and put on the screen after having the last ebuild merged.

  7. If /etc/portage/make.conf is configured to save the elog (and this is strongly recommended) read the post install messages and consider to do what is reported. The post install messages are summarized on the screen when emerge finishes. If you do not have a gui, the elogs can be read in /var/log/portage/elog. Using mc is a good tool for that on the side on the left the files are listed and on the left side the quick view shows the content. If you have a graphical ui, consider to install and use elogviewer for that.

  8. To check if some news got emerged: eselect news list. If you have something eselect news read 1 and to delete all the ones eselect news purge

  9. Check /usr/src or eselect kernel list for latest kernel source and verify it type uname -r in the console. To update the kernel go to the kernel compilation section.

  10. Check if you have the newest python eselect python list. When updating run python-updater afterwards. emerge python-updater might be necessary first.

  11. Check perl using perl-cleaner --all or perl-cleaner --reallyall

Cleanup tasks

/etc/portage/package.keywords holds packages that got installed when they were not stable. As time goes by they might be stable or even outdated. Therefore it is always wise to put packages with their version number into /etc/portage/package.keywords. As an example the following entry uses a not stable version:

=media-tv/mtvg-6.2.18-r1 ~x86

So check what you have installed, if newer wipe out the above. If no version number is present then check what you have installed and define a range up to the installed version:

<=media-tv/xmltv-0.5.50 ~x86

/etc/portage/package.mask holds the packages where you have decided to not install them. In meantime they might be outdated by newer version and therefore this file should be cleaned. It is wise to just mask certain versions.

/etc/portage/package.unmask holds packages that are hard masked and you have unmasked them. Verify if they are still hard masked and unmask them.

To do it automatically emerge portpeek and then run portpeek -arf. If it complains about some files not found, then check if those files are really missing and do something as touch /etc/portage/package.accept_keywords

Check also /etc/conf.d/modules some of your modules loaded there might now be delivered (as staging drivers or be now stable) within the kernel source.

Backup data

Backup your data. This is best done to have the data consistent on different PC and an external hard disk. To have the data consistent between all those devices emerge unison.

Store the data to a DVD or CD using tools as k3b is an other option. Unfortunately backup-ed data might become corrupt after some years. CD and DVD's should retain the data for a couple of 10 years and a Hard disk might crash after 10 years. It will be a frustrating moment when you have a hard disk crash and you take the backup thinking you are save but then you notice that the backup is corrupt.

Therefore verify your backup (e.g once a year). After making some tests with:

To verify the data on DVD's and CD's emerge dvdisaster.

To check the data on a hard disk diff (or the graphical diffuse) and cmp can be used.

It is also advisable that you backup important configuration data as /var/lib/portage/world , this file holds all ebuilds that you have emerged. The program genservice can be configured to backup the important files. See: .

Check disk space


If the disk is full, a crash happens and some data is lost. Therefore be aware about your disk and try to move movies and disk images of virtual PC away from the partition where your work and system resides!

To see how the space is used on the disk use a disk usage analyzer as baobab coming with gnome or filelight or to find the big ones df -T if you are in text mode (when run as root all files are visible otherwise just the ones where you have access). To get size of directories use du :

  1. du -s ~ to see how big is your home directory in kBytes

  2. du -sb ~ to see how big it is in Bytes (1 kByte=1024 Bytes)

Clean data from updates.

Manually delete the files in /usr/portage/distfiles/ and /usr/portage/packages/ is not recommended, since errors could be made easily and it is not obvious what files belong to what ebuild. Additionally under some desktop environments it will end up in the roots trash bin and therefore not visible.

Use eclean distfiles or eclean packages to delete old files where no ebuild exist anymore (emerge gentoolkit first) or use eclean --destructive distfiles or simply eclean -d distfiles to delete all distfiles except the ones installed (Respectively eclean --destructive packages or eclean -d packages ).

man eclean shows that there are alternative calls for eclean:

eclean-dist, eclean-pkg, eclean -dist or eclean -pkg

Remove old kernel stuff

  1. Kernel sources are slotted packages, so all kind of versions get collected in /usr/src. Old kernels get removed during updates as any other packages, however the directories and all files created during compilation remain under /usr/src. This is also true for the modules found in /lib/modules.

    If you check with eselect kernel list then not the installed kernel sources pop up but as stated, the existing symlinks to the kernel source directories. Some of them have the source files removed, but the files created during kernel compilation are still there. Those directories are pretty useless, so you can remove them including their modules. To be save run uname -a to see what kernel you use.

    To know what kernel sources are installed do: equery list gentoo-sources

  2. Clean up /boot. To not end up with just one kernel that does not boot, leave more than one kernel there.

In case of having grub legacy update /boot/grub/grub.conf accordingly.

There is also emerge eclean-kernel that could do it automatically.

Type eselect python list and delete no more used python site-packages in /usr/lib/python<n.m>. If it got messy run python-updater afterwards.

If no emerge command runs, further check the directory: /var/tmp/portage. It can contain leftovers that emerge did not clean, probably due to emerge errors, so clean it manually.

The logfiles in /var/log/messages might get huge. So install and use logrotate to limit the size automatically by performing periodic backups as gz files. Under Gentoo the file /etc/cron.daily/logrotate calls it periodically

Alternatively deleting them manually. Otherwise delete the logs directly manually.

If you run a desktop environment than the trash bin might be full. So remove files from trash bin.


GUI's have trash bins and those can getting full. Also root and the different users have their garbage, you might have to delete it from a shell, since delete via GUI might move garbage around but does not destroy it. For example if you do a lot of kernels, your trash on your boot partition accumulates. As regular user you will not see a full trash that belongs to the root. Use the console or mc for getting rid of it.

Programs add hidden directories in /home/<user>/.<name of the program> to save persistent data. Check if such directories from programs that have been removed still exist and delete them. Sometimes it is also wise to delete them since incompatibilities with old versions can exist and the those directories will be reproduced when the program is re-started.


Just delete directories where you are sure what they are for.

Checking dependencies

Since your Linux installation is GPL, it consist of many small pieces that all have versions and depend from each other. Usually emerge and its ebuilds handle those very complex situation very well.

/var/lib/portage/world => list of all packets that you have manually installed (hopefully intentionally installed). Therefore check if you know all the packages there. See the world file section for details.

To check /var/lib/portage/world emaint -c world. Or do all checks: emaint -c all.

If it fails with IOError: [Errno 2] No such file or directory: '/usr/portage/packages/Packages' do

mkdir /usr/portage/packages

To allow emaint to fix the things

emaint -f all

To check the consistency of your installation run first:

emerge --update --deep --newuse world

Or the more complete command (@word means that world is a set and not a single package)

emerge --update --newuse --deep --with-bdeps=y @world

then run:

emerge --depclean --pretend

check what it wants to remove. If it wants to remove something that you like to keep, add them to /var/lib/portage/world either via regular editor or

emerge --noreplace <package-name> and re-check again. Then do the

emerge --depclean

and check if some other packages need to be re-emerged: emerge @preserved-rebuild

Once there was from emerge gentoolkit the program revdep-rebuild that served for similar things.

Check unused useflags

The file /etc/portage/make.conf holds useflags set by the user that differ from the default ones. When the installation is old, the number of use flags get longer and longer. And finally many useflags might no more be needed and can be removed. euses <useflag> shows what packages could use them and emerge -s <package> shows if those packages are installed.

Linurs Hosttech startpage