Created
October 15, 2023 00:21
-
-
Save BlendyDev/7b20f6e1002751658932db13cb0df0c0 to your computer and use it in GitHub Desktop.
Script to rollback Arch Linux packages to a certain date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [[ $(/usr/bin/id -u) -ne 0 ]]; then | |
| echo "Not running as root" | |
| exit | |
| fi | |
| echo -ne "Enter date (YYYY/MM/DD): " | |
| read date | |
| echo $date | |
| mv -v /etc/pacman.d/mirrorlist /tmp/mirrorlist.bak | |
| echo "Server = https://archive.archlinux.org/repos/$date/\$repo/os/\$arch" >> /etc/pacman.d/mirrorlist | |
| cat /etc/pacman.d/mirrorlist | |
| pacman -Syyuu | |
| rm -v /etc/pacman.d/mirrorlist | |
| mv -v /tmp/mirrorlist.bak /etc/pacman.d/mirrorlist | |
| echo "DONE!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment