Keeping Gentoo Up To Date

These are a few steps I like to run to update my box. If you don’t know what the command does, look it up. I take no responsibility if it hoses your box.

Sync your portage:

emerge --sync

Update all packages:

emerge -DuNqa world

Remove old dependencies:

emerge --depclean -qa

Check for and fix broken libraries:

revdep-rebuild -i -- -qa

Verify you have removed old libraries and fix linking to them:

RM="";
REVDEP="";
for i in `zgrep "# rm '" /var/log/portage/elog/* | cut -f 2 -d "#" | sort -u | sed 's/rm //'`;
do
 RM="$RM $i";
 REVDEP="$REVDEP|$i";
done;

if [[ -n $RM ]];
then
 echo &&
 echo `echo $REVDEP | sed s/^\|//` &&
 echo &&
 revdep-rebuild -i `echo $REVDEP | sed s/^\|//` -- -qa &&
 echo &&
 echo `echo $RM | sed s/\'//g` &&
 echo &&
 rm -i `echo $RM | sed s/\'//g`;
fi

Update your configuration files:

etc-update

Show which process need to be restarted:

lsof -n +c0 | grep 'DEL.*lib' | cut -f 1 -d ' ' | sort -u

References

  1. Gentoo Linux
  2. Gentoo Newsletter 20080930 Chapter 4