Arch Linux is a rolling-release system that expects users to update regularly.
This can be a problem if you find yourself in possession of an older Arch Linux
machine that hasn't been kept up to date. In particular, if you'd like to back
up the contents of the system and reinstall, you may want certain tools available
to do it (in my case it was pigz
).
However, if they tools aren't already installed, you're out of luck: Arch's package repositories store only very recent versions of every package.
For emergencies like this, I've written the attached script, which automates package fetching from the Arch Linux Archive.
It's a good idea to keep your system up to date. Sometimes, a package is revved for a good reason, such as a serious security flaw, or a package builder compromise. So in general you don't want to do this.
However, this script does avoid the main risk in installing old versions of packages: since it queries the version in the locally sync'd Pacman database, you will at least install a package version that is consistent with the rest of your (ancient, out of date, insecure) operating system.
And, of course, Pacman will verify that the signature on the package is legit, in terms of your (ancient, out of date) Pacman keyring.