pacman

Checking Cache

# Count cached packages
        sudo ls /var/cache/pacman/pkg/ | wc -l

        # Check disk space used
        du -sh /var/cache/pacman/pkg/

Cleaning Cache

# Remove all but 3 most recent versions
        sudo paccache -r

        # Keep only 1 most recent version
        sudo paccache -rk 1

        # Remove all cached versions of uninstalled packages
        sudo paccache -ruk0

        # Remove all uninstalled packages
        sudo pacman -Sc

        # Remove all packages from cache (use with caution)
        sudo pacman -Scc

Mirrorlist Management

# Edit mirrorlist
        visudo /etc/pacman.d/mirrorlist

        # Generate ranked mirror list
        reflector [options]

Note: Always verify changes before applying. Backup important files.