====== Updating Gentoo Daily ====== ===== Syncing Portage ===== In order to update your system you need to syncrhonise your local portage tree (and overlays) with those on the central servers (or its mirrors). If you've multiple [[gentoo overview|Gentoo]] servers on your home network then you should ideally be using a centralised portage tree that you are sharing over [[nfs portage|NFS]]. You can use a ''cron'' job to synchronise your portage tree automatically, whether its on your local machine, or your [[nfs portage|NFS portage]]. The simplest and most comprehensive method to syncing portage and overlays is to use the handy ''eix-sync'' command that comes as part ''app-portage/eix''. If you have not done so already then [[eix|emerge eix]]. To update portage and any overlays that are defined simply eix-sync ==== cron job ==== It can be a pain having to sit, manually update portage and overlays and wait for it to finish before updating. A simple solution is to use a ''cron'' job to schedule syncing over night (or at least in the background). Edit root's cron jobs (with ''crontab -e'') and add the following line. #Mins Hours Days Months Day of the Week 00 10 * * * /usr/bin/eix-sync This will sync your portage tree at daily at 00:10. ===== Updating ===== Now that portage (and overlays) are up-to-date its time to start updating your system. This is pretty straight forward, as root emerge -uDNav world If your happy to update the list of programs that have newer ebuilds/versions available then simply answer Yes (''y'') when asked if you want to update. ===== Configuration Files ===== Often new configuration files will be made available with new updates. There are various tools for managing updates to your configuration files, the example below uses ''dispatch-conf'' which is part of ''sys-apps/portage'' so will be available on all Gentoo systems. After emerging has finished you'll usually be informed if there are configuration files that need updating, if this is the case then simply dispatch-conf ===== Cleaning your system ===== If you want to remove a package then you simply ''emerge -Cav foo-bar'', but that doesn't necessarily remove the dependencies that were pulled in by that package and are not required by any others on your system. Theres a very simple way to do this though using emerge --depclean -a Check the list of packages and if your happy go ahead and remove the packages. ===== Rebuilding packages ===== Sometimes portage makes mistakes and might have removed a package that is actually required, or one of your libraries might have been updated as part of ''world'' in which case all packages that depend on that particular library are likely to require recompiling against that library (particularly if there has been a major version change in the library). This is simple to achieve too. revdep-rebuild ===== Perl ===== Occasionally you'll find that some packages don't emerge cleanly, and this can be down to problems with the [[wp>Perl]] modules that are installed. Its straight-forward to resolve these problems by updating your perl modules. emerge -av perl-cleaner perl-cleaner --all ===== Resolving Slot Conflicts ===== Sometimes you get seemingly unresolvable slot conflicts where multiple versions of the same package are trying to be installed at the same time which isn't permitted. You can try and get round this with the ''--backtrack'' option to increase the depth to which Portage searches to resolve things. Upping to 30 is a good start, if that doesn't work, try a higher number. ===== Links ===== * [[gentoo>HOWTO Use Portage Correctly]] {{tag>gentoo linux portage emerge update howto tips}}