Installing Previous Versions of Arch Linux Packages

Option 1: Use the Arch Linux Archive

Open the Arch Linux Archive index of packages, locate the particular package and the desired version, and then copy the link for the .tar.zst file.

Open a terminal and use pacman -U along with the link to install the package:

pacman -U https://archive.archlinux.org/packages/c/<pkgname>/<pkgname>-<pkgver>-x86_64.pkg.tar.zst

Confirm the package with the required version was installed:

pacman -Qi <pkgname>

Option 2: Use Source Files

Find and Download the Source Files

  • Open the Arch Linux web-page for the package to be installed (e.g. CUDA). Package specific web-pages can be found by searching for the package on the Arch Linux package search web-page.
  • Click on Source Files to navigate to the associated GitLab page.
  • Change the revision from the default "main" branch to the revision with the desired version. This will update the repository to the point in time of the desired version.
  • Click on Code and select zip under the Download source code section in the pop-up menu.

Building and Installing

Open a terminal and navigate to the downloaded .zip file:

cd ~/downloads

If unzip is not available, install it:

sudo pacman -S unzip

Extract the downloaded .zip file:

unzip <downloaded-pkg.zip>

If the extraction was successful, remove the downloaded .zip file:

rm -rf <downloaded-pkg.zip>

Navigate to the trunk subdirectory:

cd <download-pkg>/trunk

Make the package:

makepkg

If required dependencies are missing, makepkg will issue a warning before failing. Note the missing packages and install via pacman. Alternatively, one can run makepkg --syncdeps to temporarily install the missing packages.

Once all dependencies are satisfied and the package builds successfully, a package file (pkgname-pkgver.pkg.tar.zst) would have been created in the working directory.

Install the package:

makepkg --install

Navigate up two parent directories:

cd ../..

Remove the directory containing the source files:

rm -rf <downloaded-pkg>

Confirm the package with the required version was installed:

pacman -Qi <pkgname>

Preventing Automatic Updates

After installing an older version of a package, the next time pacman is run to update the system packages it will attempt to download and install the latest version. There are two options to prevent this.

Edit the pacman Configuration File

Edit the /etc/pacman.conf file using your preferred text editor:

sudo nvim /etc/pacman.conf

Uncomment the #IgnorePkg = line and then add the package names with space separation. For example, when complete, this part of the file will look like this:

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
IgnorePkg   = pkgname1 pkgname2 pkgname3
#IgnoreGroup =

Save and quit. pacman will not update these packages until their names are removed from this file.

Use the ignore Flag with pacman

As a temporary solution, one can instead use the ignore flag along with a comma-separated list of package names when using pacman to update packages. For example:

sudo pacman -Syu --ignore pkgname1,pkgname2,pkgname3

This list and the ignore flag will have to be passed to pacman every time an update command is run to prevent these packages from being updated.