Arch Linux, as a rolling and DIY distribution, needs to be updated with caution, especially when installing or updating packages from third-party repositories such as AUR. Inadvertent operation may cause system crashes, and it is your responsibility to maintain the stability of Arch Linux. However, errors are inevitable, and pursuing the latest software can sometimes lead to software package corruption. In this case, no panic is needed! You can easily roll back to previous stable versions. This tutorial briefly describes how to downgrade packages in Arch Linux and its derivatives such as EndeavourOS and Manjaro Linux.
The officially recommended method is only valid if the pacman cache is not cleared. If you have cleared the cache, you can still downgrade it using the following methods.
For Arch Linux and its derivatives, there is a utility called "downgrade" that helps you downgrade installed packages to any available older versions. This utility checks for older versions of required packages in your local cache and remote server (Arch Linux repository). You can select any of the old stable packages from the list and install it.
Table of contents
The "downgrade" package is not available in the official repository. You should install it from AUR or unofficial archlinuxfr repository. First, we will explain how to install it from AUR.
The downgrade package is available in AUR , so you can install it using any AUR helper like Paru or Yay .
Using Paru :
<code>$ paru -S downgrade</code>
Using Yay :
<code>$ yay -S downgrade</code>
Warning: Official Arch Linux developers and trusted users do not perform any type of test to verify the content of the unofficial repository. You must decide whether to trust its maintainers and assume full responsibility for any consequences of using any unofficial repository.
To add the archlinuxfr repository, edit the /etc/pacman.conf file:
<code>$ sudo nano /etc/pacman.conf</code>
Add the following line:
<code>[archlinuxfr] Server = http://repo.archlinux.fr/$arch</code>
Save and close the file.
Update the repository with the following command:
<code>$ sudo pacman -Syu</code>
Then, install the "Downgrade" utility from your terminal using the following command:
<code>$ sudo pacman -S downgrade</code>
Typical usage of the "downgrade" command is:
<code>$ sudo downgrade [PACKAGE, ...] [-- [PACMAN OPTIONS]]</code>
Suppose you want to downgrade the opera browser to any available older version.
To do this, run:
<code>$ sudo downgrade opera</code>
This command lists all available versions (old and new versions) of the opera package obtained from the local cache and remote image.
Sample output:
<code>可用的软件包: 1) opera-37.0.2178.43-1-x86_64.pkg.tar.xz (本地) 2) opera-37.0.2178.43-1-x86_64.pkg.tar.xz (远程) 3) opera-37.0.2178.32-1-x86_64.pkg.tar.xz (远程) 4) opera-36.0.2130.65-2-x86_64.pkg.tar.xz (远程) 5) opera-36.0.2130.65-1-x86_64.pkg.tar.xz (远程) ... (其余输出省略) ...选择一个软件包的编号:</code>
Simply enter the package number of your choice and press Enter to install it.
That's it. The currently installed package will be downgraded to the old version.
Suggested reading:
Before updating Arch Linux, check Arch Linux news and forums for any reported issues. I've been using Arch Linux as my main operating system for years. Here are some simple tips I've learned over a period of time to avoid installing unstable packages in Arch Linux.
For more details, see the Arch Linux Maintenance Guide .
The 'downgrade' package is hosted in AUR. If you doubt the authenticity of the AUR package and you do not want to install the package from AUR and unofficial repositories (archlinuxfr), I recommend that you downgrade the package as explained in the Arch Wiki.
resource:
Related readings:
This revised output maintains the original image and its format while paraphrasing the text to create a pseudo-original article. The structure and content remains largely the same, but the wording has been altered to avoid direct copying.
The above is the detailed content of How To Downgrade A Package In Arch Linux. For more information, please follow other related articles on the PHP Chinese website!