How to Downgrade a Package on Arch Linux

This article provides step-by-step instructions on how to downgrade a package on Arch Linux.

Arch Linux is a rolling-release distribution, which means it continuously delivers the latest software updates. While this is a significant advantage for many users who want bleeding-edge features and software, there can be cases where a newly updated package introduces a bug, breaks compatibility, or behaves differently in ways that disrupt your workflow. In such situations, knowing how to downgrade a package can be a lifesaver.

In this guide, we’ll walk through the different methods of downgrading packages on Arch Linux, explain where to find older versions, and explore tips on how to prevent unwanted updates in the future.


Why Would You Downgrade a Package?

Before we dive into the methods, let’s quickly go over common reasons for downgrading a package:

  • A recent update introduced a bug or crash.
  • An application lost a feature after an update.
  • A dependency change broke compatibility.
  • You need a specific version for development or testing.

Whatever the reason, Arch Linux makes it possible to downgrade, although it requires more manual intervention compared to distributions with built-in version management tools.


Method 1: Downgrade Using the Package Cache

By default, pacman, Arch Linux’s package manager, keeps a cache of downloaded packages in /var/cache/pacman/pkg. This means you can often find the previous version of a package right on your system.

Steps

  1. Check the package version history in cache:

    ls /var/cache/pacman/pkg | grep <package_name>
    

    For example, to find older versions of Firefox:

    ls /var/cache/pacman/pkg | grep firefox
    
  2. Install the older version manually:

    Use pacman -U to install a specific version from the cache:

    sudo pacman -U /var/cache/pacman/pkg/firefox-120.0.1-1-x86_64.pkg.tar.zst
    
  3. Prevent it from being updated again (optional but recommended):

    Add the package to the IgnorePkg list in /etc/pacman.conf:

    IgnorePkg = firefox
    

    This prevents the package from being automatically upgraded during a system update.


Method 2: Downgrade Using the Arch Linux Archive (ALA)

The Arch Linux Archive is a repository of all past packages and configurations. It allows you to download any specific version of a package that has ever existed in the official repos.

Steps

  1. Find the desired version:

    Visit the Arch Linux Archive:
    https://archive.archlinux.org/packages/

    Navigate to the directory of the package (e.g., f/firefox) and find the version you need.

  2. Download the package file:

    Right-click the link for the .pkg.tar.zst file and copy the URL, or download it via wget:

    wget https://archive.archlinux.org/packages/f/firefox/firefox-120.0.1-1-x86_64.pkg.tar.zst
    
  3. Install the downloaded package:

    sudo pacman -U firefox-120.0.1-1-x86_64.pkg.tar.zst
    
  4. Add it to the IgnorePkg list (if needed):

    Modify /etc/pacman.conf as mentioned earlier.


Method 3: Use the downgrade Script

The Arch community maintains a simple script called downgrade that makes the entire process easier.

Installation

You can install it from the AUR (Arch User Repository) using an AUR helper like yay or paru:

yay -S downgrade

Or clone and install it manually:

git clone https://aur.archlinux.org/downgrade.git
cd downgrade
makepkg -si

Usage

sudo downgrade <package_name>

This will present a list of available versions (including ones from the ALA and your local cache). Select the version you want, and it will handle the installation.

The script will also ask if you want to automatically add the downgraded package to the IgnorePkg list.


Method 4: Manually Build an Older Version from the ABS or AUR

If the older version is not available in the cache or the ALA, you can try building it manually from the Arch Build System (ABS) or from the AUR.

Steps

  1. Search for the package history:

    Go to https://github.com/archlinux/svntogit-packages or use the asp tool (now replaced by pkgctl):

    sudo pacman -S devtools
    pkgctl repo clone <package_name>
    
  2. Checkout the older commit (tag) with the version you need.

    cd <package_name>
    git checkout <commit_hash>
    
  3. Build and install:

    makepkg -si
    

This method requires more knowledge and effort, especially if the package has many dependencies or if the older version is not compatible with newer system libraries.


Locking the Downgraded Package

As mentioned before, if you downgrade a package, pacman will upgrade it again during the next pacman -Syu unless you block it.

Add it to /etc/pacman.conf

IgnorePkg = firefox

To ignore multiple packages:

IgnorePkg = firefox libxul thunderbird

Alternatively, to ignore group updates:

sudo pacman -Syu --ignore=firefox

But this needs to be specified every time, so editing pacman.conf is the preferred method.


Reverting the Downgrade

If you later want to revert the downgrade and return to the latest version, simply run:

sudo pacman -S <package_name>

Or, if it was in IgnorePkg, remove or comment out the line from /etc/pacman.conf first.


Caveats and Warnings

  • Dependencies: Downgrading a package may lead to conflicts or runtime errors if its dependencies have newer versions. You may also need to downgrade those.

  • Manual Intervention: Unlike systems like Nix or Guix, Arch does not manage versions declaratively. Manual downgrading comes with some maintenance overhead.

  • Security Risks: Older versions might be vulnerable to known exploits. Always evaluate the security implications of rolling back.

  • Kernel Downgrades: Be very careful when downgrading the Linux kernel, especially if you’re using custom modules (e.g., for NVIDIA drivers or VirtualBox). Incompatibilities can lead to a system that won’t boot.


Summary

Downgrading a package on Arch Linux is entirely feasible, although it requires some manual intervention. Depending on your needs, you can use:

MethodUse Case
Pacman CacheQuick rollback to a recently installed version
Arch Linux ArchiveAccess older versions not in cache
downgrade ScriptEasy, interactive downgrades
Manual BuildFor advanced users or uncommon packages

To ensure system stability after a downgrade, remember to lock the version in pacman.conf, and always test thoroughly if the package is critical to your workflow.

Despite its rolling nature, Arch’s flexibility empowers users to maintain full control over their package versions — a key reason why it remains a favorite among advanced Linux users.