Fixing There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them in CentOS

Tried to install atop in one of the CentOS servers. Due to the fact this server is locked down, the install process failed. Next thing I know yum is giving me grief with the following error

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.

 

Fixing There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them in CentOS - blackMORE Ops - 1

Next up I tried to do an yum update and it gave me an error. Nothing serious, but just annoying that CentOS is halfway stuck installing atop.

root@someserver [~]# yum update
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
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.
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32-504.1.3.el6 will be installed
--> Finished Dependency Resolution
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32-358.6.2.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================
Installing:
kernel x86_64 2.6.32-504.1.3.el6 updates 29 M
Removing:
kernel x86_64 2.6.32-358.6.2.el6 @updates 116 M

Transaction Summary
============================================================================================================================================
Install 1 Package(s)
Remove 1 Package(s)

Total download size: 29 M
Is this ok [y/N]: N
Exiting on user Command

 

So to resolve this yum-complete-transaction is required to complete the unfinished transactions, which is the mess created by a failed atop installation.

 

yum-complete-transaction(8) – Linux man page

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.

 

Fixing “There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them” in CentOS

First you need to install yum-utils package which contains yum-complete-transaction. To install yum-utils, use the following comand:

root@someserver[~]# yum install yum-utils 
(or)
someuser@someserver[~]# sudo yum install yum-utils 

Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
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.
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.30-30.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================
 Package                           Arch                           Version                                Repository                    Size
============================================================================================================================================
Installing:
 yum-utils                         noarch                         1.1.30-30.el6                          base                         110 k

Transaction Summary
============================================================================================================================================
Install       1 Package(s)

Total download size: 110 k
Installed size: 307 k
Is this ok [y/N]: y
Downloading Packages:
yum-utils-1.1.30-30.el6.noarch.rpm                                                                                   | 110 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : yum-utils-1.1.30-30.el6.noarch                                                                                           1/1 
  Verifying  : yum-utils-1.1.30-30.el6.noarch                                                                                           1/1 

Installed:
  yum-utils.noarch 0:1.1.30-30.el6                                                                                                          

Complete!

Fixing There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them in CentOS - blackMORE Ops - 2

Now just issue the following command to do a cleanup only.

root@someserver [~]# yum-complete-transaction --cleanup-only
(or)
someuser@someserver [~]# sudo yum-complete-transaction --cleanup-only

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Cleaning up unfinished transaction journals
Cleaning up 2014-10-29.11:34.57

Fixing There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them in CentOS - blackMORE Ops - 3

Next verify using yum update command

root@someserver [~]# yum update
(or)
someuser@someserver [~]# sudo yum update

Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32-504.1.3.el6 will be installed
--> Finished Dependency Resolution
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32-358.6.2.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================
 Package                      Arch                         Version                                     Repository                      Size
============================================================================================================================================
Installing:
 kernel                       x86_64                       2.6.32-504.1.3.el6                          updates                         29 M
Removing:
 kernel                       x86_64                       2.6.32-358.6.2.el6                          @updates                       116 M

Transaction Summary
============================================================================================================================================
Install       1 Package(s)
Remove        1 Package(s)

Total download size: 29 M
Is this ok [y/N]: n
Exiting on user Command

As you can see now yum commands can be run without the unfinished transactions warning.

Check Also

HELK - An Open Source Threat Hunting Platform

HELK – An Open Source Threat Hunting Platform

The Hunting ELK or simply the HELK is an Open Source Threat Hunting Platform with advanced analytics capabilities such as SQL declarative language, graphing, structured streaming, and even machine learning via Jupyter notebooks and Apache Spark over an ELK stack.

Vulnerability Scanner For Container Images & Filesystems

Vulnerability Scanner For Container Images & Filesystems

A vulnerability scanner for container images and filesystems. Easily install the binary to try it out. Works with Syft, the powerful SBOM (software bill of materials) tool for container images and filesystems.

3 comments

  1. If you dont use ‘yum-complete-transaction –cleanup-only’, then ‘yum-complete-transaction’ will mess up many things. Thanks for pointing posting the correct suggestion.

    • It doesn’t say it will mess things up in the article if you run ‘yum-complete-transaction’.

  2. very helpful thanks

Leave your solution or comment to help others.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from blackMORE Ops

Subscribe now to keep reading and get access to the full archive.

Continue reading