Manjaro Difference between revisions of "Downgrading packages"

Difference between revisions of "Downgrading packages"

From Manjaro
imported>Handy
(Created page with " As well as the information on this page, there is a wiki page called Using Downgrade [https://wiki.manjaro.org/index.php?title=Downgrade] which I highly recommend that you ...")
 
m
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
As well as the information on this page, there is a wiki
<languages/>
page called Using Downgrade [https://wiki.manjaro.org/index.php?title=Downgrade] which I highly
__TOC__
recommend that you read. The '''Downgrade''' program takes
<translate>
just about all of the hardwork out of both downgrading &
<!--T:1-->
finding all of the packages both on your machine & on the
{{warning|Downgrading packages will almost always leave you in an unsupported partial upgrade state. These instructions are intended for advanced users who understand the consequences of downgrading packages}}
web that you can use. In fact it simplifies the process
beyond belief.
_______________________________________________


<br clear="all"/>
=Introduction= <!--T:2-->
=Introduction=


You can downgrade the packages that you think may be causing the problem. Providing you haven't cleaned your '''/var/cache/pacman/pkg''' cache of the installation packages (this wiki page provides an easy way to '''Maintain your Pacman Cache''' [https://wiki.manjaro.org/index.php?title=Maintaining_/var/cache/pacman/pkg_for_System_Safety].  
<!--T:3-->
There are sometimes circumstances that require downgrading a package temporarily.  While this should not be an issue for Manjaro users on the stable branch, it is sometimes needed when using the unstable branch.


Once upon a time, if you didn't have the older version of the package on your machine, then it got a whole lot harder. These days, one of the benefits of using Downgrade [] is that it has made that problem easy to solve (providing you still have internet access).


<br clear="all"/>
=The easy way using Manjaro Downgrade= <!--T:4-->
==A Pacman method==


I do it via looking at the '''/var/log/pacman.log''' which is date/time coded down the left hand side which helps us navigate the file.
<!--T:5-->
'''manjaro-downgrade''' is an application that helps automate the process of locating and downgrading packages.


Then using the command line I change directory into where all the installation packages are stored using the following command:


cd /var/cache/pacman/pkg
==Installing Manjaro Downgrade== <!--T:6-->


Now that we are in the working directory it makes the next part a bit simpler.
<!--T:7-->
First you need to install Manjaro Downgrade, which is available in the official repositories of Manjaro. This can be done with the following command:


We have to use the following command to install the previously installed version of the packages that need to be downgraded:
<!--T:8-->
pamac install manjaro-downgrade
 
 
==Using Manjaro Downgrade== <!--T:9-->
 
<!--T:10-->
To use '''manjaro-downgrade''' simply run the command followed by the name of the package you want to downgrade.  For example:
 
<!--T:11-->
manjaro-downgrade firefox
 
<!--T:12-->
This will result in output which looks like this:
 
<!--T:13-->
Available packages:
    1)  firefox    55.0.3  1  x86_64  (remote)
    2)  firefox    60.0.1  1  x86_64  (remote)
    3)  firefox    64.0.2  1  x86_64  (remote)
    4)  firefox    64.0.2  1  x86_64  (local)
    5)  firefox    65.0    1  x86_64  (remote)
    6)  firefox    65.0    2  x86_64  (remote)
    7)  firefox    65.0.1  1  x86_64  (remote)
    8)  firefox    65.0.2  1  x86_64  (remote)
-  9)  firefox    66.0    0  x86_64  (local)
    10)  firefox    66.0    1  x86_64  (remote)
    11)  firefox    66.0.1  1  x86_64  (remote)
    12)  firefox    66.0.2  1  x86_64  (remote)
    13)  firefox    66.0.3  1  x86_64  (remote)
    14)  firefox    66.0.4  1  x86_64  (remote)
+  15)  firefox    66.0.5  1  x86_64  (remote)
+  16)  firefox    66.0.5  1  x86_64  (local)


sudo pacman -U <package.name>.pkg.tar.xz
<!--T:14-->
The entries listed as "local" are versions from your local package cache. The entries identified as "remote" are available from the Arch Linux Archive(ALA).


The whole name of the package must be identical to what it is called in the '''/var/cache/pacman/pkg''' directory, or it won't work.
<!--T:15-->
{{warning|Installing packages from the ALA is inherently dangerous as sometimes Manjaro needs custom versions of certain packages.  Doing this can result in a broken system.  As a result, downgrading from the ALA is disabled by default on the stable branch. If needed, you can enable it by setting the environment variable <pre>DOWNGRADE_FROM_ALA=1</pre>}}


The simplest way that I've found to list the contents of the ''/var/cache/pacman/pkg'' directory in a useful manner for this operation is to open a 2nd tab in my Terminal & use the following command (be sure to cd into the directory prior to using this command):


[handy@jarmano /var/cache/pacman/pkg]$ ls | more
==Adding packages to the ignore list== <!--T:16-->


Without the command prompt:
<!--T:17-->
After downgrading the package, you should see a message similar to this:
add firefox to IgnorePkg? [y/n]


ls |more
<!--T:18-->
If you answer "y", the package will no long be upgraded in future updates until you manually remove it from the '''IgnorePkg''' line of '''/etc/pacman.conf'''


Now you can move through the list of packages (the '''space bar''' moves to the next page & '''q''' quits the '''more''' display program) & highlight, copy, then move to the first Terminal tab & paste in the package name.


I use the cursor control keys to bring up the last package downgraded & then delete its name & paste in the next one after the '''sudo pacman -U''' .
=Downgrading packages manually= <!--T:19-->


<br clear="all"/>
<!--T:20-->
==Sometimes Trial & Error==
The directory {{ic|/var/cache/pacman/pkg}} contains old versions of packages.  First look for the package that you wish to downgrade is this directory then use {{ic|pacman -U}} to install it.  For example, it could look like this:


It sounds harder & slower than it really is, the more you do it the more used to it you become & it just becomes a set of repetitive actions that go by pretty fast.


As far as choosing which packages to downgrade you have probably done some reading & know the most likely ones already. If they don't do it just look at that section of the pacman.log & choose more packages until you get it functioning.
<!--T:21-->
We have to use the following command to install the previously installed version of the packages that need to be downgraded:


<br clear="all"/>
<!--T:22-->
==Block the Offender(s)==
sudo pacman -U /var/cache/pacman/pkg/firefox-64.0.2-1-x86_64.pkg.tar.xz


After that you need to block those packages from being upgraded next time you want to upgrade your system. (At least until there is a new version of any offending package.)


To do that you need to use your editor in root mode to add the simple package names into the '''/etc/pacman.conf''' file, like so:
==Ensuring downgraded packages won't be upgraded again== <!--T:23-->


<!--T:24-->
In order to stop these packages from being upgraded the next time you run updates, you can add them to the ignore list in '''/etc/pacman.conf'''.  Look for the section that looks like this:
  # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
  # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
  IgnorePkg   = ace-of-penguins nerolinux avidemux
  # IgnorePkg =


Remove the '''#''' from in front of the '''IgnorePkg''' line, & add your package names after the equal sign, separated with a space.
<!--T:25-->
   
Remove the comment in front of '''IgnorePkg''' and add the package name to the list. When you are done it should look like this:
<br clear="all"/>
  # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
=Support=
IgnorePkg = firefox


Following is a link to this page's forum counterpart where you
<!--T:26-->
can post any related feedback: [https://forum.manjaro.org/index.php?topic=4808.0]
Once this is done the package will no long be upgraded in future updates until you manually remove it from the '''IgnorePkg''' line of '''/etc/pacman.conf'''
</translate>


<br clear="all"/>
[[Category:Contents Page{{#translation:}}]]
[[Category:Contents Page]]
[[Category:Packages{{#translation:}}]]

Latest revision as of 20:11, 14 September 2023

Other languages:
English • ‎Türkçe • ‎français • ‎русский
Warning
Downgrading packages will almost always leave you in an unsupported partial upgrade state. These instructions are intended for advanced users who understand the consequences of downgrading packages

Introduction

There are sometimes circumstances that require downgrading a package temporarily. While this should not be an issue for Manjaro users on the stable branch, it is sometimes needed when using the unstable branch.


The easy way using Manjaro Downgrade

manjaro-downgrade is an application that helps automate the process of locating and downgrading packages.


Installing Manjaro Downgrade

First you need to install Manjaro Downgrade, which is available in the official repositories of Manjaro. This can be done with the following command:

pamac install manjaro-downgrade


Using Manjaro Downgrade

To use manjaro-downgrade simply run the command followed by the name of the package you want to downgrade. For example:

manjaro-downgrade firefox

This will result in output which looks like this:

Available packages:
    1)  firefox    55.0.3  1  x86_64  (remote)
    2)  firefox    60.0.1  1  x86_64  (remote)
    3)  firefox    64.0.2  1  x86_64  (remote)
    4)  firefox    64.0.2  1  x86_64  (local)
    5)  firefox    65.0    1  x86_64  (remote)
    6)  firefox    65.0    2  x86_64  (remote)
    7)  firefox    65.0.1  1  x86_64  (remote)
    8)  firefox    65.0.2  1  x86_64  (remote)
-   9)  firefox    66.0    0  x86_64  (local)
   10)  firefox    66.0    1  x86_64  (remote)
   11)  firefox    66.0.1  1  x86_64  (remote)
   12)  firefox    66.0.2  1  x86_64  (remote)
   13)  firefox    66.0.3  1  x86_64  (remote)
   14)  firefox    66.0.4  1  x86_64  (remote)
+  15)  firefox    66.0.5  1  x86_64  (remote)
+  16)  firefox    66.0.5  1  x86_64  (local)

The entries listed as "local" are versions from your local package cache. The entries identified as "remote" are available from the Arch Linux Archive(ALA).


Warning
Installing packages from the ALA is inherently dangerous as sometimes Manjaro needs custom versions of certain packages. Doing this can result in a broken system. As a result, downgrading from the ALA is disabled by default on the stable branch. If needed, you can enable it by setting the environment variable
DOWNGRADE_FROM_ALA=1


Adding packages to the ignore list

After downgrading the package, you should see a message similar to this:

add firefox to IgnorePkg? [y/n]

If you answer "y", the package will no long be upgraded in future updates until you manually remove it from the IgnorePkg line of /etc/pacman.conf


Downgrading packages manually

The directory /var/cache/pacman/pkg contains old versions of packages. First look for the package that you wish to downgrade is this directory then use pacman -U to install it. For example, it could look like this:


We have to use the following command to install the previously installed version of the packages that need to be downgraded:

sudo pacman -U /var/cache/pacman/pkg/firefox-64.0.2-1-x86_64.pkg.tar.xz


Ensuring downgraded packages won't be upgraded again

In order to stop these packages from being upgraded the next time you run updates, you can add them to the ignore list in /etc/pacman.conf. Look for the section that looks like this:

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
# IgnorePkg =

Remove the comment in front of IgnorePkg and add the package name to the list. When you are done it should look like this:

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
IgnorePkg = firefox

Once this is done the package will no long be upgraded in future updates until you manually remove it from the IgnorePkg line of /etc/pacman.conf

Cookies help us deliver our services. By using our services, you agree to our use of cookies.