Skip to content

Instantly share code, notes, and snippets.

@lfom
lfom / parucache
Created November 12, 2022 19:43
Clear paru/pacman cache
#!/usr/bin/env bash
echo "** Starting cleaning pacman/AUR cache..."
# pacman cache directory
pcachedir="$(awk '/Cache/ {print $3}' /etc/pacman.conf)"
# paru/AUR cache directory
acachedir="$HOME/.cache/paru/clone"
toremove="$(comm -23 <(basename -a $(find $acachedir -mindepth 1 -maxdepth 1 -type d) | sort) <(pacman -Qqm) | xargs -r printf "$acachedir/%s\n")"