Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# List installed packages by repo.
# Copyright 2010 Tom Vincent <>
PACKAGES="$(pacman -Sl)"
REPOS="$(echo "$PACKAGES" | cut -f1 -d ' ' | uniq)"
mkdir -p "$OUT"
$VERBOSE && echo "Total installed packages:"
for repo in $REPOS; do
list="$(echo "$PACKAGES" | grep "^$repo")"
installed="$(echo "$list" | grep "\[installed\]")"
echo "$installed" | cut -f2 -d ' ' > "$OUT/$repo-$(date +"%F").txt"
echo "$repo: $(echo "$installed" | wc -l)/$(echo "$list" | wc -l)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment