Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is how I have been upgrading Gentoo for a long time. Is this the recommended method? Any gotchas or better methods to use?

emerge --sync
emerge -uDav world
emerge -av depclean
revdep-rebuild -v -- --ask
dispatch-conf
glsa-check -t all
glsa-check -f all
share|improve this question
5  
I add the -N flag onto emerge personally –  Tom Ritter May 19 '09 at 17:00
1  
--tree (-t) is also handy for understanding what's going on –  lkraav Aug 1 '11 at 5:12
add comment

9 Answers

up vote 1 down vote accepted

It seems like you've got it covered. The only other tip is to maybe take it a bit slower than a blind wholesale update. You can always update the packages or dependency chains individually with emerge -DNuav <atom> instead of world (use --oneshot for things you don't want to add in to the world file, like system libs for example).

Note that it's always easier to do if you keep up to date regularly rather than going for monolithic batch updates every couple of months. Also, to avoid too many surprises, you might find it helpful to subscribe to one of the mailing lists like gentoo-user (WARNING: ~100 mails a day on this list) since pretty much any major update issues are likely to show up on the list with plenty of discussion explaining how to solve them.

I would guess that the next major "problem" update will be the migration to openrc once it goes stable (it was done on ~arch middle of last year iirc with only a few issues, primarily with networking changes).

share|improve this answer
1  
Yep, definitely +1 on keeping up to date on the regular rather than in huge chunks. There are the occasional changes that just break a lot. github.com/lkraav/gentoo-cron-weekly is my simplistic weekly reporting toolset. –  lkraav Aug 1 '11 at 5:15
add comment

I've been using close to the same steps you do, except for:

  • eix-sync instead of emerge --sync because I like seeing the changes to the portage tree. This is especially nice for noticing packages I might want to install that are new to the tree.

  • layman -S (occasionally) before the main emerge to sync any changes in overlays.

  • eclean-dist -d after the revdep-rebuild to clean obsoleted tarballs. I do this after every emerge, because package downgrads aren't that common.

  • eix-test-obsolete as the last step to help keep my /etc/portage files tidy and up-to-date. This also lets me know when I have installed packages that have been completely removed from portage so I need to go get the ebuild from the repository. A recent example, I have to mask all versions of iproute2 > 2.6.22.20070710 due to the older kernel running on my Xen VPS but it was recently removed from portage.

eix-sync and eix-test-obsolete are in app-portage/eix.

eclean-dist is in app-portage/gentoolkit.

share|improve this answer
    
+1 for eix-sync –  Tim Jun 10 '09 at 5:06
add comment
glsa-check -t all
glsa-check -f all

That's what you should run first. It's unneeded if you upgrade all the packages.

Oh and I prefer cfg-update ;)

share|improve this answer
add comment

If your goal is to have the absolute latest of all packages, then yes, that seems to cover all the bases. I'm surprised this has worked for you for a long time, though, because I would imagine you'd get bitten often by blocks, broken deps, etc. In the last couple years I've become much more careful about wholesale updating, electing instead to do it piecemeal after viewing the update tree. Gentoo development seems to have passed its heyday. Maybe it's because of the rise of Ubuntu.

Anyway, one additional thing you might try, just to be really fastidious about the whole process, is cleaning out your distfiles. There are scripts out there if you search.

share|improve this answer
1  
If you stick to unmasked ebuilds then Gentoo has become quite stable in my opinion and doesn't every really break by doing a sync and emerge world. You do need to know what you are doing but the same can be said for apt or yum. I've been bitten by them both. –  John Downey May 19 '09 at 16:12
1  
Three very recent blockages/breakages I can think of are libcomerr/e2fsprogs, firefox2/3, and xorg 1.3/1.5. In all those cases it took non-trivial massaging to make the wholesale update work, and there were no ~keywords involved. –  Adam D'Amico May 19 '09 at 16:28
2  
The latest versions of portage - say within the last 6 months - automatically resolve nearly all blocks and breaks. Including libcomerr/e2fsprogs. –  Dan Carley Jun 10 '09 at 6:39
add comment

Your process is correct though running every command is probably not necessary usually I just do a sync and an update world. Emerge will tell you usually if you need to run a script to rebuild file such as during a major Python upgrade and will also tell you when to merge configuration changes. Since Gentoo doesn't actually have an upgrade path from version to version. The moment you emerge world you've got the latest version.

share|improve this answer
add comment

For a long time now I always used this procedure:

emerge -f --update --newuse --deep world && emerge --update --newuse --deep world

I, for mine, prefer to update over night. But sometimes it happens that something fails and so you have to download all (or some) programs again.

Perhaps the --newuse switch is unnecassary, but I'm often editing my make.conf so it makes sense for me.

share|improve this answer
    
You can use "--reinstall changed-use" instead of "--newuse", this reinstalls packages with use flags that you have explicitly changed. Instead of obsoleted, added use flags etc. You should still run with "--newuse" from time to time though. –  hayalci Jul 3 '09 at 22:20
add comment

Looks fine, although I wouldn't be so quick to run depclean.

Unless you have a requirement like low HDD space then you can come back and depclean at less regular intevals. There's no harm having them around for a short period. If you were unlucky enough to notice some broken packages after the update then you would be sure that they aren't a result of removing any loose dependencies.

share|improve this answer
add comment

That's the way I do it on my VPS:

step 0 (from /etc/crontab)

0 0   * * *     root    emerge --sync &> /dev/null

step 1:

emerge --update --deep --newuse world -av

step 2:

emerge --depclean && revdep-rebuild && eclean-pkg && rm /usr/portage/distfiles/*
share|improve this answer
add comment

This is what I do:

emerge --sync         //Synchronize the package manager with the latest 
                      //version of each package.


emerge -aDvNu system  //updates the system, but only important if you want the
                      //latest stable version of the actual compiler and libraries
                      //with the core system.

emerge -uDNav world   //world means everything we've asked to be emerged before
                      //this does not include things that came pre installed.
                      //N means if you change your use directives in 
                      //your make.conf file to pull in the new packages.

emerge -av depclean   //removes libraries or programs that don't have any other 
                      //dependencies because of an update.


revdep-rebuild        //means if something is broken by an update, it 
                      //recompiles it.  Fixes dynamic and static linking problems.

If you don't completely understand the comments, read this because it is the authority on how to update your gentoo packages.

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.