Home > System Tutorial > LINUX > How To Downgrade A Package In Arch Linux

How To Downgrade A Package In Arch Linux

William Shakespeare
Release: 2025-03-20 10:33:16
Original
864 people have browsed it

How To Downgrade A Package In Arch Linux

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

  • Install downgrade from AUR
  • Install downgrade from the archlinuxfr repository
  • Downgrade packages in Arch Linux
  • How to avoid package corruption and improve Arch Linux stability?
  • I don't trust AUR and other unofficial repositories. what to do?

Install the downgrade utility in Arch Linux

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.

Install downgrade 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>
Copy after login

Using Yay :

 <code>$ yay -S downgrade</code>
Copy after login

Install downgrade from the archlinuxfr repository

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>
Copy after login

Add the following line:

 <code>[archlinuxfr] Server = http://repo.archlinux.fr/$arch</code>
Copy after login

Save and close the file.

Update the repository with the following command:

 <code>$ sudo pacman -Syu</code>
Copy after login

Then, install the "Downgrade" utility from your terminal using the following command:

 <code>$ sudo pacman -S downgrade</code>
Copy after login

Downgrade packages in Arch Linux

Typical usage of the "downgrade" command is:

 <code>$ sudo downgrade [PACKAGE, ...] [-- [PACMAN OPTIONS]]</code>
Copy after login

Suppose you want to downgrade the opera browser to any available older version.

To do this, run:

 <code>$ sudo downgrade opera</code>
Copy after login

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>
Copy after login

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:

  • How to downgrade all packages to specific dates in Arch Linux

How to avoid package corruption and improve Arch Linux stability?

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.

  1. Avoid partial upgrades. This means never to run "pacman -Sy ” or “pacman -Sy”. This command will partially upgrade your system while installing the package. Instead, first update the system with “pacman -Syu” and then use “package -S ”Installing the package.
  2. Avoid using the "pacman -Syu --force" command. The --force flag will ignore package and file conflicts and you may end up with corrupted packages or corrupted systems.
  3. Don't skip dependency checking. This means not to use "pacman -Rdd ”. This command will avoid dependency checking when deleting a package. If you run this command, the critical dependencies required by another important package may also be removed. Eventually, it will break your Arch Linux.
  4. Regular backup of important data and configuration files is always a good habit to avoid any data loss.
  5. Be careful when installing packages from third-party and unofficial repositories such as AUR or archlinuxfr. And do not install software packages in large quantities of development.

For more details, see the Arch Linux Maintenance Guide .

I don't trust AUR and other unofficial repositories. what to do?

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.

  • Downgrade package

resource:

  • Downgrade GitHub repository

Related readings:

  • How to downgrade packages in Ubuntu

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template