Gentoo Linux update system
Glus is a maintenance script for Gentoo Linux systems. It keeps Portage and selected package sets up to date, rebuilds packages affected by toolchain, Perl, Python, or shared-library changes, and optionally removes obsolete packages and downloaded source archives.
It is intended for periodic system maintenance, from small daily security
updates to larger system, world, or full rebuild runs. The script can also show
the planned operations with --plan, run Portage in pretend mode with
--pretend, and print commands without executing them with --debug.
-
Unify the regular Gentoo maintenance workflow: sync Portage, update Portage itself, update selected package sets, rebuild affected packages, and clean old packages or source files when requested.
-
Use the executable
emergewrapper found under/usr/lib/python-exec/python*/emerge. This helps when the regularemergecommand is temporarily broken during Python upgrades or when the system is between two Python versions. -
Update the active binutils and GCC configuration before compiling packages so newly built binaries use the latest available development toolchain.
-
Check and repair packages with missing shared-library dependencies using
revdep-rebuild. -
Optionally verify installed package file integrity with
qcheck, reporting packages with changed or missing files while ignoring protected configuration paths. -
Rebuild Perl packages and headers affected by Perl upgrades using
perl-cleaner. -
Rebuild preserved packages, repair Portage merge metadata, and check the world file with
emaint. -
Support binary package modes, package exclusions, live package rebuilds, kernel module rebuilds, Go package rebuilds, hooks, quiet output, colored output, error email notifications, and dry-run planning.
Glus performs the update in a conservative order so that the package manager and the base build toolchain are refreshed before larger package updates are attempted:
-
Load
/etc/portage/glus.conf, validate command-line options and configured hooks, and acquire a lock so only one Glus instance runs at a time. -
Sync Portage with
emaint -a sync, unless synchronization is disabled. -
Run optional sync hooks configured with
GLUS_BEFORE_SYNCandGLUS_AFTER_SYNC. -
Clean temporary Portage build files from
/var/tmp/portagewhen it is safe to do so, and automatically merge safe Portage configuration updates withetc-update --automode -5 /etc/portage. -
Update Portage first.
-
Refresh development tools before and after package compilation: select the latest available binutils and GCC profiles, run
env-update, and refresh Python wrappers witheselect python update --python3. -
Resolve
emergethrough the Python exec wrappers in/usr/lib/python-exec/python*/emerge, which can recover from situations where the defaultemergecommand is not usable during Python transitions. -
Fetch required package sources before compiling, retrying downloads before giving up.
-
Update the requested target: security packages, explicit packages, live packages, Go packages, kernel modules, the base system, world, or a full empty-tree world rebuild.
-
Rebuild preserved packages, rebuild Perl packages, and run
revdep-rebuildto find and repair binaries linked against missing or updated libraries. WhenGLUS_QCHECK=trueor--qcheckis enabled, also runqcheck -B -P -vto verify installed package file integrity. -
Optionally run
emerge --depclean, clean old binary packages and distfiles witheclean, run compile hooks, reload systemd when required, and send an email with the last command output when a command fails.
-
flock (sys-apps/util-linux)
Prevents multiple Glus instances from running at the same time.
-
perl-cleaner (app-admin/perl-cleaner)
Find & rebuild packages and Perl header files broken due to a perl upgrade.
-
revdep-rebuild (app-portage/gentoolkit)
Scans libraries and binaries for missing shared library dependencies and attempts to fix them by re-emerging those broken binaries and shared libraries. It is useful when an upgraded package breaks other software packages that are dependent upon the upgraded package.
-
qcheck (app-portage/portage-utils)
Optionally verifies the integrity of installed package files when
GLUS_QCHECKor--qcheckis enabled. -
mailx (virtual/mta)
Send mail for alerts and notifications when
GLUS_EMAILor--emailis configured.
The latest available version can also be installed manually by running the following commands:
curl -o /usr/sbin/glus.sh 'https://raw.githubusercontent.com/inode64/glus/main/glus.sh' \
&& chown 0:0 /usr/sbin/glus.sh \
&& chmod 755 /usr/sbin/glus.sh
curl -o /etc/portage/glus.conf 'https://raw.githubusercontent.com/inode64/glus/main/glus.conf' PORTAGE OPTIONS:
-S, --[no-]sync, ${GLUS_SYNC}
Sync portage.
(default: true)
-e, --exclude <EXCLUDE>, ${GLUS_EXCLUDE}
Exclude packages.
(default: "")
-P --[no-]pretend, ${GLUS_PRETEND}
Instead of actually performing the merge, simply display what *would* have been installed if --pretend weren't used.
(default: "false")
-c --[no-]check, ${GLUS_CHECK}
Check the system.
(default: true)
--[no-]qcheck, ${GLUS_QCHECK}
Verify installed package integrity with qcheck.
(default: false)
-C --[no-]clean, ${GLUS_CLEAN}
Clean packages and source files after compile.
(default: false)
-f, --[no-]fetch, ${GLUS_FETCH}
Only download, no compile or install.
(default: false)
-b, --binary <auto|autoonly|true|false|only>, --no-binary, ${GLUS_BINARY}
Use binary packages.
Force use only binary packages for only option selected.
(default: false)
SETS:
-p --packages <PACKAGES>, ${GLUS_PACKAGES}
Add this packages for update.
(default: "")
-g --[no-]go, ${GLUS_GO}
Add go lang packages for update.
(default: false)
-m --[no-]modules, ${GLUS_MODULES}
Add kernel modules for update.
(default: false)
-l --[no-]live, ${GLUS_LIVE}
Add live packages for update. (force compile)
(default: false)
-s --[no-]security, ${GLUS_SECURITY}
Compile security relevant packages (daily process, for example).
(default: true)
ACTIONS:
--[no-]system
Compile only system core (weekly process, for example).
(default: false)
--world
Compile only system core (monthly process, for example).
--full
Recompile the entire system (annual process, for example).
--dry-run, --plan
Show the planned steps and commands without executing them.
Shows commands like --debug and disables --quiet.
MISC OPTIONS:
--[no-]debug, ${GLUS_DEBUG}
Show the commands to run.
(default: false)
-q, --[no-]quiet, ${GLUS_QUIET}
Suppress non-error messages.
(default: false)
-x, --color <auto|true|false>, ${GLUS_COLOR}
Colorize the output.
(default: true)
--email <email> ${GLUS_EMAIL}
Send mail for alerts and notifications.
(default: "")
-v, --version
Show version number and quit.
-h, --help
Show this help and quit.
The default behavior of Glus can be adjusted with multiple options. Use the --help option for the full list. By default, Glus sync the portage and update the security packages with:
glus.sh
- Update security, kernel modules and live packages
glus.sh --security --modules --live
- Update security packages and system
glus.sh --system
- Update world
glus.sh --world
- Update empty tree world and debug
glus.sh --full --debug
- Show the update plan without executing commands
glus.sh --plan
- Run the regular checks and verify installed package file integrity with qcheck
glus.sh --qcheck