When there are outstanding unfinished Yum transactions, Yum will output something like the following when running commands such as yum update:
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them. 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:
[myhost ~]% ls /var/lib/yum/{transaction-all,transaction-done}* /var/lib/yum/transaction-all.2016-11-23.07:15.21.disabled /var/lib/yum/transaction-done.2016-11-23.07:15.21.disabled [myhost ~]% sudo yum-complete-transaction Loaded plugins: product-id, refresh-packagekit, rhnplugin No unfinished transactions left. And attempting to clean up the unfinished transaction files with --cleanup-only fails to remove those files:
[myhost ~]% sudo yum-complete-transaction --cleanup-only Loaded plugins: product-id, refresh-packagekit, rhnplugin No unfinished transactions left. [myhost ~]% ls /var/lib/yum/{transaction-all,transaction-done}* /var/lib/yum/transaction-all.2016-11-23.07:15.21.disabled /var/lib/yum/transaction-done.2016-11-23.07:15.21.disabled