Exploring the yum package manager
You are probably familiar with the situation in which you install a new program but then need to restore the original state of the system because of incompatibilities, bugs, or other problems. This rollback can be fairly tricky – for one thing, older packages might be difficult to locate, and for another, the configurations might have been overwritten. An automatic rollback function is often the quickest, simplest, and cleanest approach.
To leverage the benefits of package rollback, you need to back up the current system status before you change the selection of packages – that is, whenever you install or delete packages. To help you do so, RPM has a repackage function.
The repackage process bundles the relevant files, such as configuration files, data, and program files, into a new RPM archive. The RPM repackage function adds a transaction ID to each archive and stores the archive at a fixed location.
To restore a previous installation state, remove the packages you just installed and install the repackage files you created before doing so.
To tell RPM which repackage files to install, each RPM transaction is assigned a unique number. If you delete multiple packages and their dependencies, all the repackage files will have a unique transaction ID. According to the RPM manpage, the ID is a simple Unix timestamp.
Yum can use RPM's rollback functionality if you enable the feature in the configuration files. To do so, add the following entry to /etc/rpm/macros:
If the /etc/rpm/macros configuration file does not exist, you need to create it. Then add the following line to the /etc/yum.conf file:
Once you have configured this parameter, the system will "remember" every status setting in the /var/spool/repackage folder. If you delete a package, something such as
# rpm -Uhv --rollback '3 minutes ago'
will restore the system state from three minutes ago.
Additionally, specifying --test will perform a test run and show you the actions to perform, but without actually executing the rollback. You can specify the time for the rollback as follows:
# rpm -Uhv --rollback 'YYYY-MM-DD HH:MM'
If you can't remember the time for the installation you want to roll back, just check the timestamps on the repackage files in /var/spool/repackage.
Buy this article as PDF
Spammers go low-volume, and 90% of IE browsers are unpatched.
Adobe scrambles to release patches for vulnerable Flash Player.
Four-inch-long computer on a stick lets you boot a full Linux system from any HDMI display device.
New statute would require companies to report break-ins to consumers.
Weird data transfer technique avoids all standard security measures.
FIDO alliance declares the beginning of the end for old-style login authentication.
The Linux New Media Awards have honored the most significant products, projects, people, and organizations for open source/Linux every year since 2000.
Legendary Uber-distro splits over the systemd controversy.
New LTS version offers many refinements for the Cinnamon and Mate desktops and significant improvement under the hood.
One of CeBIT’s most successful forums returns in 2015.