Keeping your Gentoo Linux server up to date isn’t as straightforward as let’s say an Ubuntu box, where you would just run $ apt-get update && apt-get upgrade && apt-get clean
for example.
Gentoo is far too flexible for a one size fits all approach. The commands outlined below come pretty close for daily use though:
We start by syncing the portage tree, required to obtain the latest packages. After which we update the “world” group (which would entail all packages currently installed) with a couple of options:
|
|
That should suffice to update about every update-able package on your system.
Always make sure to read and follow the instructions that appear after the merge!
This is exactly why the second line is mentioned separately and isn’t concatenated after the first; It gives you opportunity to execute the required steps for crucial packages that might otherwise break your system.
After that we proceed with some basic cleanup:
- Remove obsolete packages with
emerge --depclean
. - Check for broken dependencies/links with
revdep-rebuild
which will automatically fix the issues. - Delete obsolete distfiles (downloaded source packages, required to merge the binaries) for packages that no longer exist on the system with
eclean-dist
.
Running the sequence above on a regular schedule should ensure that you have a smooth running system!
Got improvements or comments on the procedure outlined above? I’d love to hear them in the comments below.