Downgrading packages with pacman

13,027

Solution 1

Generally speaking unless there is a dep depending on it (in which case leaving it that way would break something), pacman -U <older-stable-package-pkg.tar.gz> will do the job correctly. Also you should avoid -Rd when doing things that could break your system unless You know what you are doing, because otherwise the system will complain if you're trying to downgrade in a way that will break a dependency.

Solution 2

If you have packages with a newer version (i.e. testing) and you want to downgrade in batch to stable version, you can execute the following pacman commands:

Refresh the sync databases:

# pacman -Syy

Downgrade all packages with a lower version in the repos:

# pacman -Suu
Share:
13,027

Related videos on Youtube

Stefan
Author by

Stefan

I like code, beer, rock climbing and travel.

Updated on September 17, 2022

Comments

  • Stefan
    Stefan 8 months

    What is the best, or most suitable, method of downgrading packages in Arch?

    On normal days I just run the following to accomplish a quick downgrade:

     # pacman -Rd <broken-package>
     # pacman -U  <older-stable-package-pkg.tar.gz>
    

    But today I am downgrading my kernel, which is a very vital part of my linux life. I'd like to do it correctly.

    Is this the proper way? If not, what is?

  • jasonwryan
    jasonwryan almost 12 years
    Presumably, you meant to include a line about removing the [Testing] repos from your /etc/pacman.conf first. Otherwise, this will not downgrade anything...
  • juanmah
    juanmah almost 12 years
    I don't agree. If you remove the testing repo you will keep your testing packages until it appears new version in the other repos. The way I proposed let you select manually testing packages, and automatically update only normal repos (lower version in the database), furthermore downgrading testing packages if any.
  • jasonwryan
    jasonwryan almost 12 years
    You misunderstand my comment. pacman -Syy force syncs the db against the repos in pacman.conf - unless you change pacman.conf nothing will be donwgraded. Read man pacman for details.
  • juanmah
    juanmah almost 12 years
    You've missunderstood the aim of pacman -Suu. You don't need to change pacman.conf. You shall have more than one version of packages in repos to get pacman -Suu working. If you have only one version of every package pacman -Suu is useless, of course. pacman -Suu downgrades to the lower version of packages in the repos.
  • jasonwryan
    jasonwryan almost 12 years
    man pacman: -Su: "Pass this option twice to enable package downgrade; in this case pacman will select sync packages whose version does not match with the local version. This can be useful when the user switches from a testing repo to a stable one." That seems clear to me.