- Posted on
- • Operating Systems
Downgrading Packages in Each Distro
- Author
-
-
- User
- Linux Bash
- Posts by this author
- Posts by this author
-
Downgrading Packages in Linux: A Distro-Specific Guide
In the Linux world, the flexibility to manage packages precisely how you want is one of the system's greatest strengths. While upgrading packages is a common practice to ensure software functionality and security, sometimes you may encounter situations where a newer version of a software introduces a bug, removes a needed feature, or simply does not work as expected with your configuration. In such cases, downgrading packages to a previous version can be as crucial as updates. This guide aims at providing step-by-step instructions on how to downgrade packages in some of the most popular Linux distributions.
Downgrading Packages in Ubuntu and Debian
APT – Advanced Package Tool is the go-to package management system in Debian-based distributions like Ubuntu. To downgrade a package in Ubuntu or Debian, follow these steps:
Find the available versions of the package: First, you need to know which versions of the package are available in the repository. Use the command:
apt show <packageName> -a
This command will list all available versions of the package in the repositories.
Force the installation of a specific version: Once you've identified the version you wish to revert to, you can install it by specifying the version number:
sudo apt install <packageName>=<versionNumber>
Replace
<packageName>
with the name of the package and<versionNumber>
with the exact version you wish to install.Hold the package version: To prevent the package from being updated unintentionally during a future system upgrade, hold the package using:
sudo apt-mark hold <packageName>
Downgrading Packages in Fedora and CentOS
DNF – Dandified YUM is the package manager used in Fedora and newer versions of CentOS. Here’s how to downgrade packages using DNF:
Check the history of transactions: DNF keeps a history of all transactions, which can be useful to find when a particular package was updated:
dnf history
Undo the last transaction or downgrade directly: If the package was part of the recent transaction, you can use:
dnf history undo last
Alternatively, to downgrade a package directly, use:
dnf downgrade <packageName>
This command will automatically select the previous version of the package for installation.
Downgrading Packages in openSUSE
Zypper is the package manager used in openSUSE. To downgrade a package in openSUSE, follow these steps:
Find previous versions of the package: Check which versions of the package are available. Use the command:
zypper se -s <packageName>
This command will show versions available in various repositories.
Downgrade to a specific version: To downgrade the package, specify the version you want:
sudo zypper in <packageName>-<versionNumber>
Replace
<packageName>
with the name of the package and<versionNumber>
with the desired version.
Downgrading Packages in Arch Linux
Pacman is the package manager used in Arch Linux. Downgrading a package in Arch is slightly more direct:
Leverage the cache: Pacman stores a cache of all installed packages, which includes older versions unless cleaned. To downgrade a package, simply reinstall it from the cache:
sudo pacman -U /var/cache/pacman/pkg/<packageName>-<oldVersion>-x86_64.pkg.tar.xz
Be sure to replace
<packageName>
and<oldVersion>
with the actual name and version.The Arch Linux Archive: If the package isn't in the cache, the Arch Linux Archive (ALA) holds snapshots of previous package states. Access these via:
wget https://archive.archlinux.org/packages/<PackageNameFirstLetter>/<packageName>/<packageName>-<version>.pkg.tar.xz sudo pacman -U <packageName>-<version>.pkg.tar.xz
Each Linux distribution has its own specific tools and methods for package management, and knowing how to effectively downgrade packages is a valuable skill for any system administrator or enthusiast. It provides greater control over the environment and helps ensure stability—even when newer software versions aren’t cooperating.
Always remember to backup critical data before making significant changes like downgrades, as they can sometimes lead to system instability or other unexpected issues. Following the steps outlined for each distribution will allow you to confidently manage and maintain your Linux system in the state you prefer.
Further Reading
For further reading on managing software packages in Linux distributions, consider the following resources:
Debian Administrator's Handbook, Chapter 6 "Package Management": Dive deeper into Debian's package management with detailed guidance on handling packages. Read more at: Debian Administrator's Handbook
Ubuntu's Official Documentation on Package Management: Explore Ubuntu's official guide for package management, including installation, removal, and more at: Ubuntu Documentation
Fedora Documentation on DNF: Learn more about Fedora's package manager, DNF, and its capabilities directly from Fedora's official documentation at: Fedora Documentation
Arch Wiki on Downgrading Packages: For Arch Linux users, the Arch Wiki provides comprehensive details on package downgrading techniques: Arch Wiki
openSUSE Package Management with Zypper: Gain insights into managing packages on openSUSE using Zypper by visiting: openSUSE Wiki
These sources provide detailed, distribution-specific information that can enhance your understanding and skills in managing packages on Linux systems.