I have been recently facing following error when using yum/dnf:

There are unfinished DB8actions remaining. You might consider running yum-complete-DB8action, or "yum-complete-DB8action --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).

And I was wondering how to deal with this. I would like in this blog share with you my troubleshooting, as it might help someone sooner than later.

I was at that time running el7 and it was before upgrading the machine to el8. Let me first share with you the error message:

[root@SRV ~]# yum remove mariadb-libs-5.5.65-1.el7.x86_64
Loaded plugins: ulninfo
Resolving Dependencies
There are unfinished DB8actions remaining. You might consider running yum-complete-DB8action, or "yum-complete-DB8action --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
--> Running DB8action check
---> Package mariadb-libs.x86_64 1:5.5.65-1.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================
 Package                                           Arch                                        Version                                             Repository                                          Size
============================================================================================================================================================================================================
Removing:
 mariadb-libs                                      x86_64                                      1:5.5.65-1.el7                                      @anaconda/7.8                                      4.4 M

DB8action Summary
============================================================================================================================================================================================================
Remove  1 Package

Installed size: 4.4 M
Is this ok [y/N]: N
Exiting on user command
Your DB8action was saved, rerun it with:
 yum load-DB8action /tmp/yum_save_tx.2026-06-17.16-16.CupcSE.yumtx
[root@SRV ~]#

I ran a yum history command:

[root@SRV ~]# yum history
Loaded plugins: ulninfo
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    26 | root               | 2026-06-17 15:17 | E, I, U        |  184 EE
    25 | root               | 2026-06-17 14:59 | Install        |   25
    24 | root               | 2026-06-17 14:59 | Update         |    1
    23 | root               | 2026-05-07 15:21 | Install        |    1
    22 |                  | 2022-11-18 10:42 | Install        |    1
    21 |                  | 2022-11-18 09:56 | Install        |    1
    20 | root               | 2021-11-10 11:24 | Install        |    7
    19 | root               | 2021-10-26 16:54 | Install        |    1
    18 | root               | 2021-10-26 16:54 | Install        |    1
    17 | root               | 2021-10-26 16:54 | Install        |    1
    16 | root               | 2021-10-26 16:53 | Install        |    1
    15 | root               | 2021-04-08 09:30 | Install        |   14
    14 |                  | 2021-03-19 11:28 | Install        |    1
    13 | root               | 2021-01-21 11:36 | Install        |    2
    12 | root               | 2021-01-21 10:53 | Erase          |    1
    11 | root               | 2021-01-21 10:28 | E, I, U        |   37 EE
    10 | root               | 2020-11-26 11:13 | Install        |    2
     9 | root               | 2020-11-16 14:41 | I, U           |    8 PP
     8 | root               | 2020-11-16 14:35 | I, U           |  152 **
     7 |                 | 2020-10-28 15:45 | Install        |    1
history list
[root@SRV ~]# 

If I check the last transaction, it is successful. For sure, I have just run it.

[root@SRV ~]# yum history info 26 | grep Return-Code
Return-Code    : Success
[root@SRV ~]#

But if I check the transaction id 8, I see that this one was aborted:

[root@SRV ~]# yum history info 8 | grep Return-Code
Return-Code    : ** Aborted **

If I look to the RPM database changes log dated for this transaction I see the following file:

[root@SRV ~]# ls -l /var/lib/yum/DB8action-*
-rw-r--r--. 1 root root 13671 Nov 16  2020 /var/lib/yum/DB8action-all.2020-11-16.14:35.57
-rw-r--r--. 1 root root  9424 Nov 16  2020 /var/lib/yum/DB8action-done.2020-11-16.14:35.57
[root@SRV ~]#

I can check it’s content…

[root@SRV ~]# tail /var/lib/yum/DB8action-all.2020-11-16.14:35.57
erase 0:file-libs-5.11-36.el7.x86_64
erase 0:iptables-1.4.21-34.el7.x86_64
erase 2:vim-minimal-7.4.629-6.0.1.el7.x86_64
erase 0:libxml2-2.9.1-6.0.1.el7.4.x86_64
erase 0:libteam-1.29-1.el7.x86_64
erase 0:mokutil-15-2.0.3.el7.x86_64
erase 0:numactl-libs-2.0.12-5.el7.x86_64
erase 1:dmidecode-3.2-3.el7.x86_64
erase 0:iprutils-2.4.17.1-3.el7.x86_64
erase 1:mariadb-libs-5.5.65-1.el7.x86_64

[root@SRV ~]# tail  /var/lib/yum/DB8action-done.2020-11-16.14:35.57
erase 999:iwl7260-firmware-22.0.7.0-999.4.el7.noarch
erase 0:ca-certificates-2019.2.32-76.el7_7.noarch
erase 999:iwl6000g2a-firmware-17.168.5.3-999.4.el7.noarch
erase 999:iwl5000-firmware-8.83.5.1_1-999.4.el7.noarch
erase 999:iwl100-firmware-39.31.5.1-999.4.el7.noarch
erase 1:NetworkManager-tui-1.18.8-1.el7.x86_64
erase 0:rpm-python-4.11.3-43.el7.x86_64
erase 1:NetworkManager-glib-1.18.8-1.el7.x86_64
erase 32:bind-utils-9.11.4-26.P2.el7.x86_64
erase 7:lvm2-2.02.186-7.0.1.el7.x86_64
[root@SRV ~]#

Let’s take mariadb-libs RPM as example. Checking this package, I can see that it is duplicated.

[root@SRV ~]# rpm -q --last mariadb-libs
mariadb-libs-5.5.68-1.el7.x86_64              Mon 16 Nov 2020 02:38:01 PM CET
mariadb-libs-5.5.65-1.el7.x86_64              Wed 28 Oct 2020 10:39:07 AM CET
[root@SRV ~]#

Having duplicated RPM is not good. I suspect it is coming from this aborted yum transaction, old for past 6 years.

Let’s check if there is several other duplicated RPM.

[root@SRV ~]# package-cleanup --dupes
libcroco-0.6.12-6.el7_9.x86_64
libcroco-0.6.12-4.el7.x86_64
lz4-1.8.3-1.el7.x86_64
lz4-1.7.5-3.el7.x86_64
iprutils-2.4.17.1-3.el7.x86_64
iprutils-2.4.17.1-3.el7_7.x86_64
numactl-libs-2.0.12-5.el7.x86_64
numactl-libs-2.0.12-5.0.3.el7.x86_64
file-libs-5.11-36.el7.x86_64
file-libs-5.11-37.el7.x86_64
sed-4.2.2-6.el7.x86_64
sed-4.2.2-7.el7.x86_64
lshw-B.02.18-17.el7.x86_64
lshw-B.02.18-14.el7.x86_64
file-5.11-36.el7.x86_64
file-5.11-37.el7.x86_64
kmod-20-28.0.1.el7.x86_64
kmod-20-28.0.3.el7.x86_64
coreutils-8.22-24.0.1.el7.x86_64
coreutils-8.22-24.0.1.el7_9.2.x86_64
dbus-libs-1.10.24-13.0.1.el7_6.x86_64
dbus-libs-1.10.24-15.0.1.el7.x86_64
elfutils-libelf-0.176-5.el7.x86_64
elfutils-libelf-0.176-4.el7.x86_64
freetype-2.8-14.el7.x86_64
freetype-2.8-14.el7_9.1.x86_64
plymouth-core-libs-0.8.9-0.34.20140113.0.1.el7.x86_64
plymouth-core-libs-0.8.9-0.33.20140113.0.1.el7.x86_64
cpio-2.11-27.el7.x86_64
cpio-2.11-28.el7.x86_64
kmod-libs-20-28.0.3.el7.x86_64
kmod-libs-20-28.0.1.el7.x86_64
libpng-1.5.13-8.el7.x86_64
libpng-1.5.13-7.el7_2.x86_64
libteam-1.29-1.el7.x86_64
libteam-1.29-3.el7.x86_64
elfutils-libs-0.176-4.el7.x86_64
elfutils-libs-0.176-5.el7.x86_64
dbus-1.10.24-13.0.1.el7_6.x86_64
dbus-1.10.24-15.0.1.el7.x86_64
mariadb-libs-5.5.65-1.el7.x86_64
mariadb-libs-5.5.68-1.el7.x86_64
elfutils-default-yama-scope-0.176-5.el7.noarch
elfutils-default-yama-scope-0.176-4.el7.noarch
teamd-1.29-3.el7.x86_64
teamd-1.29-1.el7.x86_64
device-mapper-persistent-data-0.8.5-2.el7.x86_64
device-mapper-persistent-data-0.8.5-3.el7_9.2.x86_64
[root@SRV ~]#

Yes there are and many!

For each of the rpm, I ran following query to find the latest one.

[root@SRV ~]# rpm -q --last lz4
lz4-1.8.3-1.el7.x86_64                        Mon 16 Nov 2020 02:36:12 PM CET
lz4-1.7.5-3.el7.x86_64                        Wed 28 Oct 2020 10:34:25 AM CET
[root@SRV ~]# 

And decided to remove the last oldest version. For each yum remove command, I ensured there were no dependencies issues.

[root@SRV ~]# yum remove lz4-1.7.5-3.el7.x86_64
Loaded plugins: ulninfo
Resolving Dependencies
There are unfinished DB8actions remaining. You might consider running yum-complete-DB8action, or "yum-complete-DB8action --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
--> Running DB8action check
---> Package lz4.x86_64 0:1.7.5-3.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================================================================================
 Package                                        Arch                                              Version                                                 Repository                                                Size
=========================================================================================================================================================================================================================
Removing:
 lz4                                            x86_64                                            1.7.5-3.el7                                             @anaconda/7.8                                            358 k

DB8action Summary
=========================================================================================================================================================================================================================
Remove  1 Package

Installed size: 358 k
Is this ok [y/N]: y
Downloading packages:
Running DB8action check
Running DB8action test
DB8action test succeeded
Running DB8action
  Erasing    : lz4-1.7.5-3.el7.x86_64                                                                                                                                                                                1/1
  Verifying  : lz4-1.7.5-3.el7.x86_64                                                                                                                                                                                1/1

Removed:
  lz4.x86_64 0:1.7.5-3.el7

Complete!

I did that for all until having no duplicated any more.

[root@SRV ~]# package-cleanup --dupes
[root@SRV ~]#

So the duplicated came for sure due to this aborted transaction, id 8 that should have replaced the previous version package.

And I can confirm it. If I look to the all DB action transaction log for this transaction 8, /var/lib/yum/DB8action-all.2020-11-16.14:35.57, I can find both install and erase:

[root@SRV ~]# cat /var/lib/yum/DB8action-all.2020-11-16.14:35.57
install 1:mariadb-libs-5.5.68-1.el7.x86_64
...
erase 1:mariadb-libs-5.5.65-1.el7.x86_64

So it was planned that yum installs new version and removes old one.

But if I look to the done file, /var/lib/yum/DB8action-done.2020-11-16.14:35.57, file showing what really yum did, I will only find the install and not the erase:

[root@SRV ~]# cat /var/lib/yum/DB8action-done.2020-11-16.14:35.57
...
install 1:mariadb-libs-5.5.68-1.el7.x86_64
...

So the intention was to install version 5.5.68 and remove old 5.5.65, but as the yum transaction was aborted after the installation package, yum only installed 5.5.68 but could not remove the old one 5.5.65, thus the duplicated. Yum transaction was aborted in between.

Knowing I resolved manually the duplication, I decided to complete the aborted transaction by just doing cleanup.

[root@SRV ~]# yum-complete-DB8action --cleanup-only
Cleaning up unfinished DB8action journals
Cleaning up 2020-11-16.14:35.57
[root@SRV ~]#

cleanup-only will simply delete the stale journal. Knowing I manually resolved the problem, I think it was the right think to do.

And now I’m clean…

[root@SRV ~]# yum update
Loaded plugins: ulninfo
No packages marked for update
[root@SRV ~]#