Files
MiniServer/updates.d/95-cleanup.sh
T
2026-10-23 08:04:42 -06:00

17 lines
497 B
Bash
Executable File

#!/bin/bash
if command -v paccache &>/dev/null; then
echo "Trimming pacman package cache..."
sudo paccache -rk2
sudo paccache -ruk0
fi
# Report packages that were installed as dependencies and are no longer needed.
# Not removed automatically: some may be tools you use directly.
ORPHANS="$(pacman -Qtdq 2>/dev/null)"
if [ -n "$ORPHANS" ]; then
echo "Packages no longer needed by anything:"
echo "$ORPHANS" | sed 's/^/ /'
echo "To remove them: sudo pacman -Rns \$(pacman -Qtdq)"
fi