Update Gentoo Linux

Published on: 2024-06-06 - Permalink Gentoo Linux

Updating Gentoo is an easy process but it requires manual intervention, as with this distribution, it's very important to not skip any error and always inform yourself about what's going to be updated

Update dependency tree

eix-sync

Retrieve and compile all packages including their dependencies

emerge -avuDN --with-bdeps y --keep-going @world

Please note that we're using the --keep-going flag, in case any package won't be merged at first, we need to make a note of it and try again after all other dependencies got merged, in some cases the dependency link got broken or some packages needs to be updated beforehand, playing with the USE flags can also raise a lot of errors, mostly because some libraries were compiled with different profiles, will depend on each case what we should do in order to fix it.

Update configuration files

dispatch-conf

Never forget to check which configuration options are being updated

Delete obsolete packages

emerge -av --depclean

Cleanup using gentoolkit

revdep-rebuild

Cleanup

eclean -d distfiles

Troubleshooting

Masked packages

Some new package version are being masked, either because more testing is needed or because it hasn't been patched for a specific architecture or configuration set, the most common mask is ~amd64, if we want to go and install it we can add it on our packages.accept_keyword path in portage

tux ~ # cat /etc/portage/package.accept_keywords/libudev-compat
sys-libs/libudev-compat ~amd64

Above package is a requirement for the steam-launcher package (non-official), just like all unofficial packages, they're not deeply tested and it usually implies the usage of masked packages, we should also consider the choice of masking the conflictive package, in case you're not aware, the steam launcher updates itself periodically, so we can skip it for now, in order to do so we need to mask it:

tux ~ # cat /etc/portage/package.mask/steam-launcher
>=games-util/steam-launcher-1.0.0.78-r1

The next time we try to merge @world it will warns us for our current mask

!!! The following installed packages are masked:
- games-util/steam-launcher-1.0.0.78-r1::steam-overlay (masked by: package.mask)
For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.

That's because our package is registered in @world, but since we've also masked it, it can't be merged.

At a glance it's a good idea to avoid the usage of masked packages as much as possible.