- Learn how to revert packages in Linux depending on each major package manager.
- Discover graphical and terminal methods tailored to your experience and needs.
- Follow tips to avoid errors and lock versions for stability.
The process of rolling back to a previous version in Linux may seem complex, but there are actually several effective and accessible options depending on your distribution and experience level. Knowing how to do this will allow you to solve stability problems, incompatibilities or simply better manage the versions of your packages.Here we explain step by step the different options for restoring a previous version, always protecting the integrity of your system and avoiding errors.
If you haven't tried these methods yet, keep in mind that Tools and procedures vary between distributionsHowever, in all cases, the key is to maintain version control and understand what steps to take in each scenario.
Why revert to a previous version of a package on Linux?
In most cases, Updates bring improvements and fixes; Nevertheless, Not everything always goes as expected. Among the most common reasons for wanting to downgrade are:
- Stability issues After the update: New versions may introduce bugs that did not exist before.
- Incompatibilities with other packages or hardware.
- Removal of functions that you considered important.
- personal preference for usability or details of previous versions.
Any reason is valid, and having clear methods for downgrading will help you save time and avoid headaches.
Know what package managers exist according to your distribution
The first step to perform a successful downgrade is to identify which package manager your system works with. Each distribution has a different one, and this influences the commands and procedures:
- Debian, Ubuntu and derivatives: they use APT (sudo apt or apt-get).
- Arch Linux and derivatives: They use Pacman.
- openSUSE and SUSE: use Zypper.
- Fedora, Red Hat, CentOS and similar: use DNF or YUM.
This decision will determine which methods you'll use going forward. Below, we explain the options for each environment and offer some key tips.
Reverting to a previous version with APT on Debian, Ubuntu, and derivatives
APT Allows you to easily install specific versions of a package, giving you complete control. The steps are simple:
- Check the available versions for your package with:
sudo apt-cache showpkg package_name
- Install the chosen version indicating the package and version:
sudo apt install package_name=version
For example, to revert to a previous version of Firefox, simply replace the corresponding names and versions.
What to do if the version you're looking for isn't in the repositories? That's where it comes into play snapshot.debian.orgThis platform maintains historical archives that you can temporarily add to your sources:
- Go to snapshot.debian.org and find your package and version.
- Create a new file in /etc/apt/sources.list.d, for example virtualbox.list.
- Add the line:
deb https://snapshot.debian.org/archive/debian/fecha_y_hora/ branch contrib - Update with:
sudo apt update - Then, check and install with apt-cache showpkg and apt install.
If the package has dependencies, you can also revert them in the same way, separating them with spaces. To prevent it from being automatically updated again, you can lock its version with:
sudo apt-mark hold package_name
How to downgrade Ubuntu graphically with Synaptic
For those who prefer a graphical interface, Synaptic It offers an easy and visual solution. It allows you to view all available versions and select the one you want to install:
- Install Synaptic If you don't have it: search in the software center or run:
sudo apt install synaptic - Open Synaptic, find your package, right-click, and select “Force Version…”.
- Choose the version you want and apply the changes.
- Optionally, lock the version from future updates from the "Package" menu.
This method is ideal if you prefer to use a graphical interface and want to avoid unnecessary commands or risks.
Downgrade on Arch Linux and derived distributions
Arch Linux, with its rolling release model, constantly updates. However, you can roll back if something fails, thanks to the save to /var/cache/pacman/pkg/ all downloaded versions:
- Find the cached versions with:
ls /var/cache/pacman/pkg/ | grep package_name - Once you have identified the version, install it with:
sudo pacman -U /var/cache/pacman/pkg/package_name-version.pkg.tar.xz
If you have deleted the cache, you can use services like Arch Rollback Machine to get older packages. To prevent reinstalling an unwanted version, add it to IgnorePkg in /etc/pacman.conf, but be careful not to cause conflicts.
Restoring packages on openSUSE and SUSE with Zypper
On openSUSE and derivatives, zipper It has a mechanism to manage previous versions taking advantage of its history:
- Consult installation history with:
cat /var/log/zypp/history | grep package_name - When you find the desired version, reinstall it with:
sudo zypper -in -f package_name-version
This method is very useful in cases of recent errors or conflicts after updates, facilitating a quick and safe restoration.
Downgrade on Fedora, Red Hat, CentOS and similar with DNF or YUM
In these systems, DNF allows you to consult and reinstall previous versions as long as they are in the repositories:
- See available versions:
sudo dnf –showduplicates list package_name - Install the selected version:
sudo dnf install package_name-version
To revert recent changes, you can explore your transaction history with:
- View history:
sudo dnf history - Details of a specific transaction:
sudo dnf history info ID - Undo a transaction:
sudo dnf history undo ID
This method allows the system to return to a previous state effectively, very useful in production environments or in critical systems.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.