Yum Complete Transaction

There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them. The program yum-complete-transaction is found in the yum-utils package.- Running transaction check- Package e2fsprogs.x8664 0:1.39-34.el58.1 set to be updated. The yum-complete-transaction command finds incomplete or aborted yum transactions on a system and attempts to complete them. It looks at the transaction-all and transaction-done files which can normally be found in /var/lib/yum if a yum transaction aborted in the middle of execution. First I had to install yum utils: yum install yum-utils Have tried yum-complete-transaction and other stuff without luck, I gave up the transaction with: yum-complete-transaction -cleanup-only Then I got a sorted list of duplicated packages so I could identify older versions to remove filtering even and odd lines later. The program yum-complete-transaction is found in the yum-utils package. Running transaction check - Package PyYAML.x8664 0:3.10-3.el6 will be updated.

Introduction

Complete

The yum package manager maintains a history of all yum based transactions i.e. software installation, update and removal operations. This history is kept in an sqlite database (rpmdb) which is available in the /var/lib/yum/history/ directory. The transaction history in the rpmdb can be queried via the yum history command. We would also like to point out that a log of package installs, updates and removals is maintained in a text file as well located at /var/log/yum.log. The file provides one line descriptions about the yum related actions that were performed. But a very interesting facet of the yum transaction history is that transactions can be repeated and reversed and also incomplete transactions can actually be resumed. In this article we’ll be focusing on how we could resume incomplete yum transactions and complete them to fruition.

Demonstration

Yum-complete-transaction Loop

Rhel

With a basic understanding of how yum transactions are maintained, let’s perform a practical demonstration of how we could resume an incomplete yum transaction. Consider the following operation, we are just installing the openssl package on our system. What if during the installation we loose our network connectivity. This is just a single package so repeating the installation isn’t challenging but if it were an entire system update then redoing the entire task from scratch would be tedious. To simulate an interruption I hit the ctrl+c key to stop the yum package installation.

The log containing the progress of the above interrupted transaction has been saved in /tmp in a file named yum_save_tx.2018-03-02.12-34.RZUTa5.yumtx. This file is a simple text file and we can view it’s contents as shown below.

To resume the transaction we use the load-transaction sub-command with the yum command followed by the complete path to the .yumtx file.

It might not seem obvious from the above command line output but the openssl package installation actually resumed exactly from where I had left it off. If you wish to check if the system has any incomplete transactions and complete them then use the yum-complete-transaction command.

To only cleanup incomplete transactions without resuming them, use the following command.

Command

Conclusion

This concludes our demonstration of how we could use yums’ transaction history feature to resume incomplete transactions. We hope that you’ve found this demonstration to be useful and we look forward towards your feedback.

The following two tabs change content below.

Yum Complete Transaction Not Working

He started his career in IT in 2011 as a system administrator. He has since worked with HP-UX, Solaris and Linux operating systems along with exposure to high availability and virtualization solutions. He has a keen interest in shell, Python and Perl scripting and is learning the ropes on AWS cloud, DevOps tools, and methodologies. He enjoys sharing the knowledge he's gained over the years with the rest of the community.

Yum Complete Transaction Cleanup Only

  • Google Cloud basics: Activate Cloud Shell - May 19, 2021
  • Create persistent swap partition on Azure Linux VM - May 18, 2021
  • DNF, YUM and RPM package manager comparison - May 17, 2021
  • Introduction to the aptitude package manager for Ubuntu - March 26, 2021
  • zypper package management tool examples for managing packages on SUSE Linux - March 26, 2021