Skip to content

Instantly share code, notes, and snippets.

@ichramm
Last active March 4, 2021 00:36
Show Gist options
  • Save ichramm/c62cff6d46a9c273d94617c8b1c82ba2 to your computer and use it in GitHub Desktop.
Save ichramm/c62cff6d46a9c273d94617c8b1c82ba2 to your computer and use it in GitHub Desktop.
(Archlinux) Update check for packages installed from the AUR
#!/bin/bash
pacman -Qmq | while read package; do
cur_version=$(pacman -Qi $package | egrep 'Version *:' | sed 's/Version *: *//'); # fast
aur_version=$(yaourt -Si $package | egrep 'Version *:' | sed 's/Version *: *//'); # slow
if [ "$cur_version" = "$aur_version" ]; then
echo -e "\e[0;32mUp to date: \e[0m$package";
else
echo -e "\e[1;33mNeeds update: \e[0m$package \e[0;33m(installed: $cur_version, aur: $aur_version)\e[0m";
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment