How to backup and restore yum?

Is there a way to back up a package that will change during a yum upgrade? For example, when I do yum update lighttpd, is there a way to backup and restore lighttpd if yum update is not successful or if it leads to unexpected errors or errors?

+3
source share
3 answers

If you use RPM before 4.6.0 ( it is removed in newer versions ), you can use the mechanism rpm --rollback, for example, in this old tutorial or in a more complete article with some kind of functionality description. The --rollback function is an automatic solution that has been removed because it is not reliable.

You may have a manual solution that keeps a list of all packages before updating yum and reinstalling the necessary old rpms, possibly using -oldpackage, for example rpm -Uvh --oldpackage foo-1-1.i386.rpm:

To get a list of all installed packages sorted by installation time:

rpm -q -a --queryformat '%{INSTALLTIME} %{NAME}-%{VERSION}-%{RELEASE}\n' | sort -n 

( Source )

Fedora, , .

( rpm), .

+3

. , "yum downgrade lighttpd" ( yum "yum history undo" ). , rpm "yum downgrade lighttpd *. Rpm" ( ). , , , - .

"yum-plugin-fs-snapshot", FS (btrfs LVM) ... . . , .

+1

etckeeper /etc. etckeeper /etc ( , Git, Mercurial Bazaar) Linux (APT, YUM, Pacman).

If something bad happens during the update, I can roll back something.

0
source

Source: https://habr.com/ru/post/1748426/


All Articles