Skip to content

System Maintenance & Keyring

Maintaining a rolling-release distribution like Arch Linux requires periodic housekeeping: reclaiming disk space from package caches, removing orphaned dependencies, checking upstream news before updates, and ensuring your PGP keyrings are up to date.

Shelly provides three specialized subcommands for system health:

  • shelly purify - Prunes old ALPM package caches, removes compiled AUR build caches, removes unused orphaned dependencies, and frees unreferenced Flatpak runtimes.
  • shelly news - Displays unread Arch Linux news announcements and manual intervention notices before running system upgrades.
  • shelly keyring - Initializes distribution keyrings, refreshes keyservers, and imports developer signing keys for AUR source verification.

Whenever you install or upgrade packages, ALPM stores the downloaded archives in /var/cache/pacman/pkg/. Over time, this cache grows and consumes gigabytes of disk space. Similarly, building AUR packages leaves compiled archives in Shelly’s cache.

shelly purify analyzes your system and builds a structured cleanup plan for package caches, orphaned dependencies, and unused Flatpak runtimes.

Remove older cached package versions while keeping the latest versions as a rollback buffer (retaining 3 versions by default):

Terminal window
# Clean cache while keeping the 3 most recent versions
shelly purify standard
# Retain only the 2 most recent versions
shelly purify standard --cache 2

Before making any changes to your filesystem or package database, pass -d (or --dry-run) to preview the exact packages and sizes targeted for removal:

Terminal window
shelly purify standard --orphans --cache 2 --dry-run

On Arch Linux, major package transitions or upstream architectural changes occasionally require manual user intervention. The Arch Linux maintainers publish announcements on archlinux.org/news.

shelly news fetches the official news feed, displays unread announcements formatted cleanly in your terminal, and remembers which items you have already viewed.

Terminal window
# Show unread announcements
shelly news

To inspect previously read announcements or browse the archive:

Terminal window
shelly news --all

Keyring & Signature Verification (shelly keyring)

Section titled “Keyring & Signature Verification (shelly keyring)”

Arch Linux packages and PKGBUILD sources rely on OpenPGP signatures to guarantee authenticity. If keyrings become desynchronized or missing, updates or AUR builds may fail with signature verification errors.

Shelly integrates key management through shelly keyring (powered by shelly-key).

If you encounter invalid or corrupted package (PGP signature) errors during updates, repopulate the distribution keys. Note that shelly keyring init creates missing keyring structure but does not delete an existing keyring - if the keyring itself is corrupt, wipe it manually first (step 3 below).

  1. Initialize the keyring structure, import and trust the signing keys from every installed distribution keyring (Arch Linux, CachyOS, etc.), then refresh keys from the configured keyservers:

    Terminal window
    shelly keyring init
    shelly keyring populate
    shelly keyring refresh
  2. Terminal window
    shelly upgrade standard

    If signature errors are gone, no further action is needed.

  3. If errors persist, the keyring data itself is likely corrupt. Delete it and repopulate:

    Terminal window
    sudo rm -rf /etc/pacman.d/gnupg/
    shelly keyring init
    shelly keyring populate
  4. If signature errors continue even after a full reset, the keyring is not the problem - suspect a broken mirror serving corrupted packages or a stale sync database. Switch to working mirrors, clear the package cache, and remove the sync database so it is re-downloaded:

    Terminal window
    sudo rm -R /var/lib/pacman/sync

2. Importing Developer Keys for AUR Builds

Section titled “2. Importing Developer Keys for AUR Builds”

When a PKGBUILD specifies validpgpkeys=(...), Shelly’s build engine validates the downloaded source tarball against that developer’s PGP key.

To import an upstream developer’s public key into your user keyring for source verification:

Terminal window
# Import into the user's GPG keyring
shelly keyring recv <FINGERPRINT> --user
# Optionally specify an explicit keyserver
shelly keyring recv <FINGERPRINT> --user --keyserver hkps://keyserver.ubuntu.com

Option Short Description
--cache <N> -c Remove older cached package versions while retaining <N> versions (default: 3).
--orphans -o Include orphaned dependencies in the cleanup plan.
--aur-cache Delete all cached AUR package archives and signatures.
--dry-run -d Display the planned cleanup targets without altering packages or deleting files.
Subcommand Shortcode Description
shelly keyring init shelly -Ki Initialize the system package-signing keyring.
shelly keyring populate shelly -Kp Populate keyring with default distribution keys.
shelly keyring refresh shelly -Kr Refresh keys from configured keyservers.
shelly keyring recv shelly -Kv Receive public keys (use --user for PKGBUILD source keys).
shelly keyring lsign shelly -Ks Locally sign a key in the keyring.
shelly keyring list shelly -Kl List all keys in the package-signing keyring.
Terminal window
shelly -Zs # Equivalent to: shelly purify standard
shelly -Zso # Equivalent to: shelly purify standard --orphans
shelly -Zsd # Equivalent to: shelly purify standard --dry-run
shelly -Zf # Equivalent to: shelly purify flatpak
shelly -N # Equivalent to: shelly news
shelly -Na # Equivalent to: shelly news --all

© 2026 Seafoam LabsShelly Chel