emaint
Perform Gentoo system maintenance
TLDR
Synchronize repositories that are set to auto-sync (default for most repositories)
Synchronize a specific repository
Synchronize all repositories
Clear the Portage resume list
Clean Portage logs
SYNOPSIS
emaint [options] <subcommand> [args]
PARAMETERS
-h, --help
Display help message and exit
--version
Show emaint version information
-q, --quiet
Reduce output verbosity
-v, --verbose
Increase output verbosity
--debug
Enable debug output
checkblocks [--fix] [--verbose]
Check and optionally fix blocked packages in vdb
checknews [--cron] [--quiet] [--notify]
Check for unread news items
cleanset [setname [atom ...]]
Clean package set by removing uninstalled atoms
distclean
Clean distfiles directory
gennewsxml
Generate XML for news items
listnews [--quiet] [--category category] [--scope scope]
List available news items
sync [--auto]
Sync metadata cache (vdb)
world [scan | diff | merge] [--backtrack=1] [--quiet]
Maintain @world set for USE changes
DESCRIPTION
emaint is a command-line tool in Gentoo Linux's Portage package management system, designed for routine maintenance tasks. It ensures the package database (vdb), world sets, and metadata caches remain consistent and up-to-date, preventing issues during package builds and updates.
Primary uses include syncing the volatile database cache with emaint sync, which is faster than full emerge --sync; managing the @world set via emaint world to detect USE flag changes and update package lists; handling Gentoo developer news with checknews or listnews; cleaning package sets with cleanset to remove uninstalled entries; and resolving blocked packages using checkblocks --fix.
emaint is lightweight and ideal for cron jobs, supporting automation with --auto or -a flags. It reduces manual intervention, improves emerge reliability, and keeps systems current with news items that may require action before upgrades. Global options control verbosity and output.
CAVEATS
Gentoo-specific; some subcommands (e.g., world, sync) require write access to /var/db/pkg or root. Use --auto cautiously in cron to avoid conflicts with manual emerges.
COMMON EXAMPLES
emaint sync -a # Auto-sync vdb cache
emaint world -a # Auto-update world set
emaint checknews -q # Quiet news check
CRON USAGE
Typical cron: 0 2 * * 0 /usr/bin/emaint sync -a >/dev/null
Run daily/weekly for maintenance.
HISTORY
Introduced in Portage 2.1.5 (2008) to consolidate maintenance scripts. Evolved in Portage 2.2+ with enhanced world scanning and news handling; now integral for automated Gentoo setups.


