Issue
Is there a way to make a backup of package that will be change while yum update? For example when I do yum update lighttpd is there a way to backup and restore lighttpd if yum update will be unsuccessful or it will result in unsuspected errors or bugs?
Solution
If you're using RPM before 4.6.0 (it's removed in newer versions), you can use rpm --rollback
mechanism like in this old tutorial or in a more complete article with some functionality explanation. The --rollback feature is an automatic solution that was removed since it isn't reliable.
You can have a manual solution, keeping a list of all the packages before the yum update and reinstall needed old rpms possibly using --oldpackage like 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)
If you're using Fedora, here is an official guide to upgrade the system using the installer with an example of how to create a list of system current installed packages and how to restore most of old software after an upgrade.
If you want a generic approach to get a list of installed software (not only rpm based), you can follow this article as well.
Answered By - GmonC Answer Checked By - Timothy Miller (WPSolving Admin)