Skip to content

Instantly share code, notes, and snippets.

@riivanov
Created May 15, 2024 15:05
Show Gist options
  • Save riivanov/16cef81493c4f06ba4982a221974ec7c to your computer and use it in GitHub Desktop.
Save riivanov/16cef81493c4f06ba4982a221974ec7c to your computer and use it in GitHub Desktop.
How to downgrade all Arch packages
# https://linuxconfig.org/how-to-rollback-pacman-updates-in-arch-linux
$ grep -a upgraded /var/log/pacman.log| grep 2020-11-30 > /tmp/lastupdates.txt
$ awk '{print $4}' /tmp/lastupdates.txt > /tmp/lines1;awk '{print $5}' /tmp/lastupdates.txt | sed 's/(/-/g' > /tmp/lines2
$ paste /tmp/lines1 /tmp/lines2 > /tmp/lines
$ tr -d "[:blank:]" < /tmp/lines > /tmp/packages
$ cd /var/cache/pacman/pkg/
$ for i in $(cat /tmp/packages); do sudo pacman --noconfirm -U "$i"*; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment