Skip to content

Instantly share code, notes, and snippets.

@t-chab
Last active August 29, 2015 14:24
Show Gist options
  • Save t-chab/3282f8bd245023b322ce to your computer and use it in GitHub Desktop.
Save t-chab/3282f8bd245023b322ce to your computer and use it in GitHub Desktop.
Simple shell script to rebuild and upgrade AUR packages
#!/usr/bin/env bash
PKG_LIST=$(pacman -Qm |awk '{ print $1}' |tr '\n' ' ')
WORK_DIR="$(mktemp -d)"
for i in $PKG_LIST
do
echo "Building package $i in $WORK_DIR/$i"
cd $WORK_DIR
prefix=$(echo ${i:0:2})
url="https://aur.archlinux.org/packages/$prefix/$i/$i.tar.gz"
echo "Fetching url $url"
curl -o "$i".tar.gz $url
tar xvfz "$i.tar.gz"
cd "$i"
makepkg -s --noconfirm --needed
sudo pacman -U "$i"*.tar.xz
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment