#!/bin/bash # Arch Linux cleanup + update script set -euo pipefail echo "==> Updating packages..." yay -Syu --noconfirm echo "==> Removing orphaned dependencies..." yay -Yc --noconfirm echo "==> Checking for broken packages..." yay -Dk echo "==> Cleaning package cache..." yay -Sc --noconfirm echo "==> Cleaning user cache..." rm -rf ~/.cache/* echo "==> Emptying trash..." rm -rf ~/.local/share/Trash/files/* rm -rf ~/.local/share/Trash/info/* echo "==> Cleaning system logs..." sudo journalctl --vacuum-time=7d echo "==> Done."