Keeping a Gentoo Install Up-To-Date

There is probably a better method to do this, but this is what I do to keep my various Gentoo boxes up to date.

Basics

  1. emerge –sync when you need to, but don’t cron it.
  2. when you require a keyword on a package, don’t use ACCEPT_KEYWORDS. Instead drop it into /etc/portage/package.keywords
    • foo/bar ~x86
  3. when you customize packages, global USE flags go into /etc/make.conf. For custom flags, don’t use “USE” on the command line. Instead drop them into /etc/portage/package.use
    • foo/bar this -that
  4. Some packages you may want to prevent upgrades, ie glibc. use /etc/portage/package.mask
    • >sys-libs/glibc-2.6.1

Updating World

  1. emerge -va --oneshot portage
  2. emerge -uDNav --with-bdeps=y --backtrack=100 --autounmask-keep-masks=y @world
  3. perl-cleaner --all
  4. emerge @preserved-rebuild
  5. emerge --with-bdeps=y --depclean -p
    • This shows packages with no dependencies that you can optionally remove. After seeing this list I like to hand pick the ones I no longer need.
  6. revdep-rebuild -p

Resolving Blocked Packages and Conflicts

  1. Try updating the package specifically that is blocking
  2. Sometimes those packages need to be removed
    • emerge -vp --depclean <atom>

Rebuilding World

After you have done all the updates, you may want to rebuild your entire tree. For example, if glibc updates.

emerge -ea world<br>emerge --resume (if you have to fix something)

Common Problems

  1. I’ve had issues in the past (since the removal of python-updater) where python dependencies aren’t rebuilding correctly. Using equery, I have been able to fix this.
    1. equery d dev-lang/python | awk '{print "\\\"="$1"\\\""}' | xargs -n 1000 emerge -vp
  2. Some issues arise with the upgrading of GCC, read this for more info on how to resolve: https://wiki.gentoo.org/wiki/Upgrading_GCC
This entry was posted in Gentoo. Bookmark the permalink.