arch-smart-update is a bash wrapper designed to safeguard system updates on vanilla Arch Linux and its derivatives. Instead of updating blindly, it gives you complete control over the upgrade process by presenting package build dates, package descriptions, official Arch news alerts, and stability recommendations from an intelligent Update Advisor β enabling you to make an informed decision before delegating the actual transactions directly to pacman, an AUR helper, or topgrade.
The script also supports distribution-specific utilities on EndeavourOS (such as eos-update) and CachyOS (such as cachy-update), while remaining fully compatible with any other Arch-based system.
- β‘ Safe RAM-Based Sync (
/tmp): The script never touches your live local pacman database during the checking phase. All database syncing and calculations are done in an isolated temporary directory in your RAM (/tmp/checkupdates-db...). This 100% prevents catastrophic "partial upgrade" scenarios if you decide to cancel the update. - π§ Smart Update Advisor: Automatically analyzes the criticality of pending packages. If a system-crashing update (like the Linux kernel,
glibc, or NVIDIA drivers) was released less than 24 hours ago, the script strongly advises you to wait, ensuring upstream stability before you apply it. - π° Arch News Integration (RSS): Fetches the latest official Arch Linux news feed. If thereβs a recent post requiring manual intervention, you'll get a bright warning before you press "Y".
- π‘οΈ Automated Pacman DB Backups & Keyring Recovery: Automatically creates a
.tar.zstbackup of/var/lib/pacman/localbefore updates. If a transaction fails due to invalid/corrupted PGP signatures or broken keys, the script automatically triggers a Keyring Hotfix (pacman-key --init && pacman-key --populate) and safely retries the update. - πΎ Storage & Btrfs Snapshot Safety Check: Calculates required disk space based on download size with an expansion multiplier. Automatically detects Btrfs and active snapshot tools (
snapper,timeshift,snap-pac), enforcing higher space thresholds to prevent transaction lockups and filesystem freezes. Also validates/bootand/efipartitions. - π Smart Mirror Management: Monitors mirrorlist age and sync health. Ranks official Arch mirrors using fast
rate-mirrors(with an automatic fallback toreflector), while seamlessly supporting distribution-specific mirror tools on EndeavourOS (eos-rankmirrors) and CachyOS (cachyos-rate-mirrors). - π Outdated AUR Rebuild Detection: Integrates with
rebuild-detector(checkrebuild) to inspect foreign packages linked against older system shared libraries (e.g. after major Python/ICU updates) and offers a one-click automated rebuild via your active AUR helper. - π Rich CLI Analytics: Displays a terminal table showing update types (MAJOR, MINOR, PATCH, CALVER, EPOCH), package age in hours, download sizes, repositories, and descriptions.
- π Intelligent Lock File Removal: Detects a stale
/var/lib/pacman/db.lckfile and checks if a package manager is actually running. It usesfuserif available, or natively extracts the lock PID and scans the process table (pgrep//proc) as a fallback to safely remove phantom locks. - π¨ IgnorePkg Conflict Checker: If you have frozen packages via
pacman.conf, the script simulates the update in the background and warns you of any dependency breakages caused by skipped packages. - π§Ή Automated System Cleanup: Optional post-update cleanup that safely removes orphaned packages, clears partial downloads, empties the pacman/AUR cache, vacuums the systemd journal (keeping 100M), and clears user thumbnail caches.
- π§© Seamless Ecosystem Integration: Full, native support for popular AUR helpers (
yay,paru,pikaur,aura,rua,trizen,pacaur,pakku), an automatic built-in AUR RPC API v5 client when no helper is installed, and compatibility witheos-update,cachy-update, andtopgrade(to handle Flatpaks, firmware, and dotfiles). - π» Background Daemon & Notifications: Fully integrated background update monitor powered by a systemd user timer. Silently checks for updates using
fakeroot(no sudo required) and sends interactive desktop notifications with Wayland and X11 support. Features intelligent snoozing (--silence), dynamic timer adaptation to Update Advisor cooldowns, boot-session awareness for Arch News, and connection failure alerts. Can be effortlessly toggled via dedicated CLI commands.
The script recognizes hundreds of packages (from DEs to base system components) and categorizes them into four threat levels, calculating a safe "cooldown" period:
- β’οΈ NUKE (System Core):
glibc,linux,nvidia,systemd,grub,cryptsetup.Recommendation: Wait 24 hours.
- β CRIT & DEs (Crucial Services & Desktop Environments):
mesa,wayland,dbus,KDE Plasma,GNOME,Hyprland, etc.Recommendation: Wait 12 hours.
- β FEAT (General Features & Utilities): Audio/Network stacks, Frameworks, EOS apps.
Recommendation: Wait 6 hours.
- π¦ Standard Packages & AUR:
Recommendation: Wait 3 hours.
- π‘ Customizing the lists: You don't have to wait for an update to add your specific apps to these categories! You can easily append your own packages to the NUKE, CRIT, or FEAT lists using the settings.conf file, and your changes will survive all future script updates.
On its first run, the script creates a configuration folder at ~/.config/arch-smart-update/, downloads the latest default templates from GitHub, and helps you set up standard features. Whenever you launch the script manually, it will display the exact path to your active configuration file at the very top.
To ensure your personal settings are never overwritten by script updates, the configuration is split into two types:
1. Developer Managed (Auto-updating via GitHub):
packages.confβ The master list of categorized packages.*.default.confβ Templates showing the latest recommended syntax.
2. User Managed (Safe from overwrites):
settings.confβ Your master configuration file, structured into 7 modular sections:- General Settings:
PROMPT_MIRROR_REFRESH(confirm mirror ranking),MAX_BACKUP_COPIES(pacman DB backup retention),AUR_HELPER_OVERRIDE,ENABLE_POST_CLEANUP,ENABLE_AUR_REBUILD_CHECK, and minimum free disk space thresholds (MIN_DISK_SPACE_MB,MIN_BTRFS_SPACE_MB). - Update Delays (Hours): Custom stability cooldown timers for packages (
T_MIRROR_H,T_FEAT_H,T_CRIT_H,T_DE_H,T_NUKE_H) and patch-level timer bypass (IGNORE_PATCH_TIMERS). - Background Checker Settings: Configure daemon monitoring (
ENABLE_BACKGROUND_CHECK), check frequency (CHECK_INTERVAL), post-boot delay (START_DELAY), snooze duration (SILENCE_UPDATES), and notification display timeout (NOTIFICATION_TIMEOUT). - Logging: Enable session log generation (
GENERATE_LOGS) and set log rotation limits (MAX_LOG_NUMBERS). - Mirror Ranking Commands: Define custom parameters for mirror ranking tools via
CUSTOM_RATE_MIRRORS_CMDorCUSTOM_REFLECTOR_CMD. - Custom Update Commands: Add custom pre/post commands in
CUSTOM_CMDSto run alongside or override standard updates (strictly verified for daemon security). - User Packages: Append your own applications to threat tiers (
USER_NUCLEAR_PKGS,USER_CRITICAL_PKGS,USER_FEATURE_PKGS) to inherit customized Advisor stability cooldowns.
- General Settings:
Whenever the master configuration on GitHub is updated, the script will quietly pull the changes without touching your custom files. If new features or options are introduced to settings.default.conf that are missing in your active settings.conf, the script will display a notice. You can safely merge and align your active configuration to adopt these new options (while fully preserving all your custom settings, user packages, and custom update commands) by running the script with the --reconfigure flag.
The script relies on standard Arch base system utilities:
sudo pacman -S bash python pacman pacman-contrib tar gawk coreutils curl zstd grep sed
Optional Dependencies:
base-devel(specificallyfakeroot) β Required for the background daemon to safely synchronize databases without sudo.libnotifyβ Required for interactive desktop notifications in daemon mode.util-linuxβ Providesscriptfor clean terminal log captures,flockfor daemon concurrency locking, andsetsidfor detached processes.xdg-utils/xdg-terminal-execβ For opening Arch News links in your default browser (xdg-open) and launching the default terminal emulator from notifications.rate-mirrorsβ Fast primary ranking tool for official Arch Linux mirrors.reflectorβ Fallback ranking tool for official Arch Linux mirrors.eos-rankmirrors/cachyos-rate-mirrorsβ For ranking distribution-specific repositories on EndeavourOS and CachyOS.rebuild-detectorβ Providescheckrebuildto identify foreign AUR packages requiring recompilation against updated libraries.flatpakβ Enables automated removal of unused Flatpak runtimes during post-update cleanup.gamemodeβ Automatically postpones background update checks while gaming.snap-pacβ Triggers automated pre/post Btrfs snapshots on update (if using Snapper).yay/paru/pikaur/aura/rua/trizen/pacaur/pakkuβ For managing foreign AUR packages.
The script is officially available in the Arch User Repository. You can install it using your favorite AUR helper:
For yay:
yay -S arch-smart-update
For paru:
paru -S arch-smart-update
If you choose to install the script manually, keep in mind that you will also have to manually download new versions to ensure stability:
cd ~curl -O https://raw.githubusercontent.com/motorrin/arch-smart-update/main/arch-smart-update.shchmod +x arch-smart-update.sh
If you installed via AUR, the command is globally available as:
arch-smart-update
If you installed Manually, the command is:
~/arch-smart-update.sh
| Option | Description |
|---|---|
| (no arguments) | Launch the interactive TUI to inspect pending updates and apply them. |
--check |
Perform a single, silent background scan and test desktop notifications. |
--enable-daemon |
Enable, configure, and immediately start the background systemd timer. |
--disable-daemon |
Stop, disable, and cleanly remove the background systemd service and timer. |
--silence [time] |
Silence/snooze notifications for a duration (e.g. 30m, 2h, 1d) or cancel with off. |
--reconfigure |
Smartly merge and update settings.conf with new upstream defaults while preserving custom settings. |
--daemon |
Internal worker mode executed by the systemd timer. |
-h, --help |
Show the help screen with all available options. |
echo $SHELL
For bash:
nano ~/.bashrc
For zsh:
nano ~/.zshrc
For fish:
nano ~/.config/fish/config.fish
If you installed via AUR:
alias up="arch-smart-update"
If you installed Manually:
alias up="$HOME/arch-smart-update.sh"
For bash:
source ~/.bashrc
For zsh:
source ~/.zshrc
For fish:
source ~/.config/fish/config.fish
If the script is still installed, run:
arch-smart-update --disable-daemon
(Alternative manual cleanup if the script was already removed):
systemctl --user disable --now arch-smart-update.timer 2>/dev/null
rm -f ~/.config/systemd/user/arch-smart-update.{service,timer}
systemctl --user daemon-reload
AUR:
sudo pacman -Rns arch-smart-update
Manual (if downloaded to a different folder, adjust accordingly):
rm ~/arch-smart-update.sh
rm -rf ~/.config/arch-smart-update
sudo rm -f /var/lib/pacman/backup/pacman_database_*.tar.zst
rm -rf ~/.cache/yay/arch-smart-update
rm -rf ~/.cache/paru/clone/arch-smart-update



