Package: jw.emerge_update
This is a script for package update and general system management in Gentoo’s portage package manager. The aim is to
automate system updating and maintenance as straight forward as possible. There are a lot of commands to be run to
keep a Gentoo Linux system healthy and tidy. Emerge alone does not do a lot. That’s where this script comes in.What does emerge_update do?The following tasks are run:Runqcheck--badonly--allto check for altered files belonging to packages installed with emerge. With a few
exceptions no files should be modified. This is a simple way to detect malicious activities e.g. by an intruder.[1]Runeix-sync-qto update the package repositoryBackup/etc(seeBackups)Runemerge @world. A lot of options are given, seeEmerge OptionsIf automatic unmasking of packages is detected,etc-update--automode=-5/etc/portageis run to make the changes
proposed byemergepermanent. If Oracle’s JDK should be downloaded, it does so. Then,emerge @worldis run again.Runemerge--depcleanto remove unnecessary packagesRunrevdep-rebuild--ignoreto rebuild packages with broken shared library dependencies due to the lastemerge.Runemerge@preserved-rebuild. Another measure to repair broken library dependencies. Gentoo recommends running
bothrevdep-rebuildand@preserved-rebuild.Runpython-updaterif an update of Python was detectedRunperl-cleaner--allRuncfg-update--update--automatic-onlyto update all config files which can be updated automatically.Runcfg-update--indexto create update indexes for the next run ofcfg-update.Runprelink--allto prelink all binaries to speed up loading them.Backup/var/db/pkg(seeBackups). If this directory is destroyed, you are inthe most serious trouble.Runqcheck--all--updateto bring the checksums up-to-date for the next run.Runemaint-callto check for potential problems or points for improvement. This does not repair anything. You can runemaint-f...eg.emaint-fallto fix things.Using emerge_updateOptions-h,--helpshow the help--dry-run,-ndon’t execute commands, just print them--verbose,-vprint commands as they are executed--version,-Vshow program’s version number and exit--outputOUTPUT,-oOUTPUTspecify output file--append,-aappend to output file instead of overwritingTo test the script, run it withemerge_update--dry-run. This way, it only shows what would be done.TipRun the script with--verbose--output/var/log/emerge_update--appendto have a nice log of what’s going on.TipRun the script withnice-19andionice-c3in order to not put the system under too much load.BackupsBackups are done by renaming and hard-linking the target ~/.local/share/applications/mimeapps.listif possible. This
does not work with mount points, however. Directories acting as a mount point are backed up as a tar file into a
backup directory (/var/lib/emerge_updateby default). The backup directory is created if necessary.NoteYou should maintain the backup directory (usually/var/lib/emerge_update) by deleting old backups. You can do
this with packagetmpwatch. The move-and-link backups retain 8 generations.Emerge OptionsEmerge is run with these options:--nospinnerThis is not desirable in automated runs of emerge--updateOnly update packages--newuseUpdate packages when the USE configuration changes--deepConsider updating dependencies--keep-goingContinue in case of error to update as much as possible--autounmaskyUnmask required packages--autounmask-writeyMake unmasking permanent--jobsnwheren= 4. This runs a maximum of 4 parallel emerge jobs--load-averagenwherenis the number of processors on-line in the system or3if this number cannot be determined.This prevents creating new emerge jobs if the load average if aboven