# some cleanup tasks for Manjaro/Arch, possibly good to be placed to /etc/cron.weekly/cleanup # and then chmod: # wget -qO - --no-check-certificate https://raw.githubusercontent.com/slrslr/ManjaroLinux-scripts/main/cleanup-cron-script-for-manjaro-arch-pacman-etc > cleanup;sudo chown root:root cleanup;sudo chmod 700 cleanup;sudo mv -v cleanup /etc/cron.weekly/cleanup # Vacuum journals sudo journalctl --vacuum-size=500M && sudo journalctl --vacuum-time=14d # Remove pacman cache yes | sudo pacman -Scc # Remove all uninstalled packages sudo paccache -rvuk0 2>/dev/null # Remove old installed packages, leave 3 sudo paccache -rvk3 2>/dev/null # Clean yay cache yay -Sc -a 2>/dev/null # Clean pamac build cache pamac clean -bv # Clean temporary build files rm -rf ~/{.cargo,.cmake,.electron,.electron-gyp,.npm,.nvm,.racket,.stack,.yarn} || true rm -rf ~/.cache/{electron,electron-builder,go-build,node-gyp,pip,yarn} || true sudo rm -rf ~/go || true # Find files not owned by any package sudo lostfiles 2>/dev/null # Update repository list sudo pacman-mirrors --fasttrack --quiet