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
- emerge --sync when you need to, but don't cron it.
- when you require a keyword on a package, don't use ACCEPT_KEYWORDS. Instead drop it into /etc/portage/package.keywords
- foo/bar ~x86
- 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
- Some packages you may want to prevent upgrades, ie glibc. use /etc/portage/package.mask
- >sys-libs/glibc-2.6.1
Updating World
emerge -va --oneshot portage
emerge -uDNav --with-bdeps=y --backtrack=100 --autounmask-keep-masks=y @world
perl-cleaner --all
emerge @preserved-rebuild
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.
revdep-rebuild -p
Resolving Blocked Packages and Conflicts
- Try updating the package specifically that is blocking
- 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 emerge --resume
(if you have to fix something)
Common Problems
- 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.
equery d dev-lang/python | awk '{print "\\\"="$1"\\\""}' | xargs -n 1000 emerge -vp
- Some issues arise with the upgrading of GCC, read this for more info on how to resolve: https://wiki.gentoo.org/wiki/Upgrading_GCC