Difference between revisions of "Downgrading packages"

Revamped existing content and integrated content from Using_Downgrade into this page
imported>Dalto
m (Dalto moved page Downgrading packages with Pacman & friends to Downgrading packages: Made more general)
imported>Dalto
(Revamped existing content and integrated content from Using_Downgrade into this page)
Line 1: Line 1:
As well as the information on this page, there is a wiki
{{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}}
page called Using Downgrade [https://wiki.manjaro.org/index.php?title=Downgrade] which I highly
 
recommend that you read. The '''Downgrade''' program takes
 
just about all of the hardwork out of both downgrading &
__TOC__
finding all of the packages both on your machine & on the
 
web that you can use. In fact it simplifies the process
beyond belief.
_______________________________________________


<br clear="all"/>
=Introduction=
=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].  
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 downgrade=
==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.
'''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 Downgrade==


Now that we are in the working directory it makes the next part a bit simpler.
First you need to install 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:
pamac install downgrade
 
 
==Using Downgrade==
 
To use '''downgrade''' simply run the command followed by the name of the package you want to downgrade.  For example:
 
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).


  sudo pacman -U <package.name>.pkg.tar.xz
{{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 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.


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):
==Adding packages to the ignore list==


  [handy@jarmano /var/cache/pacman/pkg]$ ls | more
After downgrading the package, you should see a message similar to this:
  add firefox to IgnorePkg? [y/n]


Without the command prompt:
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'''


ls |more


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.
=Downgrading packages manually=


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''' .
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:


<br clear="all"/>
==Sometimes Trial & Error==


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.
We have to use the following command to install the previously installed version of the packages that need to be downgraded:


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.
sudo pacman -U /var/cache/pacman/pkg/firefox-64.0.2-1-x86_64.pkg.tar.xz


<br clear="all"/>
==Block the Offender(s)==


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.)
==Ensuring downgraded packages won't be upgraded again==


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:
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
  # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
  IgnorePkg   = ace-of-penguins nerolinux avidemux
  IgnorePkg = firefox


Remove the '''#''' from in front of the '''IgnorePkg''' line, & add your package names after the equal sign, separated with a space.
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'''
<br clear="all"/>
=Support=


Following is a link to this page's forum counterpart where you
can post any related feedback: [https://forum.manjaro.org/t/wiki-downgrading-packages-with-pacman-friends/17651]


<br clear="all"/>
[[Category:Contents Page]]
[[Category:Contents Page]]
Anonymous user