User:Wacek/brudnopis Downgrading packages

From ArchWiki

Przed obniżeniem poziomu jednego lub wielu pakietów zastanów się, dlaczego chcesz to zrobić. Jeśli jest to spowodowane błędem , przeszukaj narzędzie do śledzenia błędów w poszukiwaniu istniejących zadań. Jeśli nie ma, dodaj nowe zadanie; lepiej jest poprawić błędy lub przynajmniej ostrzec innych użytkowników o możliwych problemach.

Warning:
  • Obniżenie jednego pakietu może wymagać obniżenia również jego zależności. Gdy liczba pakietów do obniżenia jest duża, rozważ użycie migawki. Zobacz Arch Linux Archive#How to restore all packages to a specific date.
  • Uważaj na zmiany w plikach konfiguracyjnych i skryptach. Na razie zajmie się tym za nas pacman, o ile nie ominiemy jego zabezpieczeń.
  • Jeśli obniżenie wersji wiąże się ze zmianą soname, wszystkie zależności mogą również wymagać obniżenia lub przebudowania.

Wróć do wcześniejszej wersji pakietu

Korzystanie z pamięci podręcznej pacman

Jeśli pakiet został zainstalowany na wcześniejszym etapie, a cache|pacman nie został wyczyszczony, zainstaluj wcześniejszą wersję z /var/cache/pacman/pkg/.

Ten proces usunie bieżący pakiet i zainstaluje starszą wersję. Zmiany zależności będą obsługiwane, ale pacman nie obsłuży konfliktów wersji. Jeśli biblioteka lub inny pakiet musi zostać zdegradowany wraz z pakietami, pamiętaj, że będziesz musiał również zmienić ten pakiet na starszą wersję.

# pacman -U file:///var/cache/pacman/pkg/package-old_version.pkg.tar.type

Note that type will be xz for older package builds, and zst for those following the 2020 change.

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

Obniżanie wersji jądra

In case of issue with a new kernel, the Linux packages can be downgraded to the last working ones #Using the pacman cache. Go into the directory /var/cache/pacman/pkg and downgrade at least linux, linux-headers and any kernel modules. For example:

# pacman -U file://linux-4.15.8-1-x86_64.pkg.tar.xz file://linux-headers-4.15.8-1-x86_64.pkg.tar.xz file://virtualbox-host-modules-arch-5.2.8-4-x86_64.pkg.tar.xz
Tip: If you are unable to boot after a kernel update, you can downgrade the kernel chrooting into the system. Boot using an Arch Linux USB flash installation media and mount the partition where your system is installed to /mnt. If you have /boot or /var on separate partitions, also mount them to /mnt (e.g. mount /dev/sdc3 /mnt/boot). Then chroot into the system using:
# arch-chroot /mnt
Now you can go into the pacman cache directory and downgrade the Linux packages using the command indicated above. Once done, exit the chroot (with exit) and reboot.

Arch Linux Archive

The Arch Linux Archive is a daily snapshot of the official repositories. It can be used to install a previous package version, or restore the system to an earlier date.

Rebuild the package

If the package is unavailable, find the correct PKGBUILD and rebuild it with makepkg.

For packages from the official repositories, retrieve the PKGBUILD with ABS and change the software version. Alternatively, find the package on the Packages website, click "View Changes", and navigate to the desired version. The necessary files can then be downloaded from the directory so that the package can be rebuilt.

See also Arch Build System#Checkout an older version of a package.

Old AUR packages can be built by checking out an old commit in the AUR package Git repository. For pre-2015 AUR3 PKGBUILDs, see Arch User Repository#Git repositories for AUR3 packages.

Automatyzacja

  • downgrade — A Bash script to downgrade one (or multiple) packages, by using the pacman cache or the Arch Rollback Machine. See downgrade(8) for details.
https://github.com/pbrisbin/downgrade || downgradeAUR

Return from [testing]

See Official repositories#Disabling testing repositories.