# yum install zlib-devel or # yum install /path/to/zlib-devel-1.2.7-13.el7.x8664.rpm Transaction recovery. If during an upgrade your system goes down when restarted, type: # yum-complete-transaction. This command searches for incomplete or aborted yum transactions on a system and attempts to complete them.
When there are outstanding unfinished Yum transactions, Yum will output something like the following when running commands such as
yum update
:How can I determine if there are any unfinshed transactions without any side effects? (E.g., parsing the output of
yum update
will cause plenty of side effects, such as updating repository metadata.)man 8 yum-complete-transaction
suggests that one can simply check for the existence of files matching /var/lib/yum/{transaction-all,transaction-done}*
(emphasis mine):yum-complete-transaction is a program which 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.
If it finds more than one unfinished transaction it will attempt to complete the most recent one first. You can run it more than once to clean up all unfinished transactions.
However, this doesn't seem to be entirely accurate. For instance, I have a system where such files exist, but
yum-complete-transaction
reports that there are no transactions left to complete:And attempting to clean up the unfinished transaction files with
jayhendrenjayhendren--cleanup-only
fails to remove those files:5,53722 gold badges1616 silver badges4747 bronze badges
1 Answer
Here is a solution that outputs a count of the number of unfinshed transactions:
![Complete Complete](/uploads/1/2/4/8/124801199/691213099.png)
According to the source code for
yum-complete-transactions
from yum-utils
, all /var/lib/yum/transaction-all*
files are counted as unfinshed transactions......except for those files ending with
disabled
:Unfortunately the latter code is inside the
jayhendrenjayhendrenmain()
function of yum-complete-transaction.py
and cannot be independently called. If this code were more modularized, then it might be possible to write a Python script that more accurately checks for unfinished transactions than the shell pipeline given above.5,53722 gold badges1616 silver badges4747 bronze badges
Not the answer you're looking for? Browse other questions tagged yum or ask your own question.
Every once in a while it can happen happen that use use “yum update” to update your Linux system.
Usually this works without a hitch, but you may have come across a message such as this:
Setting up Install Process
Resolving Dependencies
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.
Resolving Dependencies
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.
But what does this mean, and how do we alleviate this?
This message means that yum didn’t quite finish something the last time the command ran. Lucky for us, we’re even given a solution: run yum-finish-transaction. If you’ve tried, you may have noticed that you don’t have the command, because it needs to be installed separately (as part of a suite called yum-utils). We can do this like so:
2 | yum clean all |
Now you should be able to run
The command will give you something like this:
yum may also warn you that there are “outstanding transactions” and that you should run yum-complete-transaction… but since that’s what you’re doing you can safely ignore that warning.
After a short while, all should be well again, and you can run yum update without problems.