How can I downgrade packages?

pacman

(nobody) #1

How can I downgrade packages?


When trying to run a program in Konsole I get the error message "foo: error while loading shared libraries: libfoo.so.1.2.3: cannot open shared object file: No such file or directory" - what should I do?
I can't connect to second monitor using HDMI
(Hans Tovetjärn) #2

Before downgrading one or more packages, consider why you wish to do so. If it is due to a bug, search the issue tracker for existing issues. If there are none related due to the bug, create a new issue; it is better to resolve issues, or at least warn other users of them.

:warning: Downgrading one package may require that its dependencies be downgraded as well. Also see When trying to run a program in Konsole I get the error message "foo: error while loading shared libraries: libfoo.so.1.2.3: cannot open shared object file: No such file or directory" - what should I do? and the #soname-bump tag.

Downgrading using the pacman cache

If a package was installed at an earlier stage, and the pacman cache was not cleaned, install an earlier version from /var/cache/pacman/pkg/. This process will remove the current package and install the older version. Dependency changes will be handled, but pacman will not handle version conflicts. If a library or other package needs to be downgraded with the packages, please be aware that you will have to downgrade this package yourself as well.

# pacman -U /var/cache/pacman/pkg/package-old_version.pkg.tar.xz

Once the package is reverted, temporarily add it to the IgnorePkg section of pacman.conf, until the difficulty with the updated package is resolved.

Downgrading the kernel using a live media

:warning: When using --rbind, some subdirectories of dev/ and sys/ will not be unmountable. Attempting to unmount with umount -l in this situation will break your session, requiring a reboot. If possible, use -o bind instead.

If you are unable to boot after a kernel update, then you can downgrade the kernel via a live media. Once it has booted, mount the partition where your system is installed to /mnt, and if you have /boot or /var on separate partitions, mount them there as well (e.g. mount /dev/sdc3 /mnt/boot). Then chroot into the system. In the following example /location/of/new/root is the directory where the new root resides.

First, mount the temporary api filesystems:

# cd /location/of/new/root
# mount -t proc proc proc/
# mount --rbind /sys sys/
# mount --rbind /dev dev/

And optionally:

# mount --rbind /run run/

Next, in order to use an internet connection in the chroot environment copy over the DNS details:

# cp /etc/resolv.conf etc/resolv.conf

Finally, to change root into /location/of/new/root using a bash shell:

# chroot /location/of/new/root /bin/bash

Here you can go to /var/cache/pacman/pkg and downgrade the packages. At least downgrade linux, linux-headers and any kernel modules. For example:

# pacman -U linux-3.5.6-1-x86_64.pkg.tar.xz linux-headers-3.5.6-1-x86_64.pkg.tar.xz virtualbox-host-modules-4.2.0-5-x86_64.pkg.tar.xz

Exit the chroot (with exit), reboot and you should be done.


(Hans Tovetjärn) #3

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.