Cannot install update, error unpacking rpm

I am attempting to use dnf update to update all of the packages on my Rocky 8 system. When I attempt to do so one of the packages fails to install with the error “Error unpacking rpm package”. I can get the update to complete if I use --skip-broken but that isn’t a great solution beyond a few times.
The package in question is setup version 2.12.2-11. Here is the verbose output from DNF.(Yes I know root isn’t good for general use.)

[root@server1 ~]# dnf --verbose -y update
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, kpatch, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync, system-upgrade
DNF version: 4.7.0
cachedir: /var/cache/dnf
Unknown configuration option: pkg_gpgcheck = 1 in /etc/yum.repos.d/centrify-rpm-redhat.repo
Unknown configuration option: autorefresh = 1 in /etc/yum.repos.d/centrify-rpm-redhat.repo
User-Agent: constructed: 'libdnf (Rocky Linux 8.10; generic; Linux.x86_64)'
repo: using cache for: bacula-enterprisee
bacula-enterprisee: using metadata from Wed 20 Dec 2023 09:15:31 AM UTC.
repo: using cache for: InteloneAPI
InteloneAPI: using metadata from Mon 20 May 2024 04:26:38 PM UTC.
repo: using cache for: appstream
appstream: using metadata from Mon 10 Jun 2024 06:31:07 PM UTC.
repo: using cache for: baseos
baseos: using metadata from Mon 10 Jun 2024 06:31:13 PM UTC.
repo: using cache for: extras
extras: using metadata from Mon 10 Jun 2024 06:17:36 PM UTC.
repo: using cache for: powertools
powertools: using metadata from Mon 10 Jun 2024 06:30:23 PM UTC.
repo: using cache for: centrify-rpm-redhat
centrify-rpm-redhat: using metadata from Fri 07 Jun 2024 05:50:57 AM UTC.
repo: using cache for: epel
epel: using metadata from Sat 15 Jun 2024 12:28:08 AM UTC.
repo: using cache for: epel-modular
epel-modular: using metadata from Tue 13 Sep 2022 01:46:46 AM UTC.
repo: using cache for: webmin-noarch
webmin-noarch: using metadata from Tue 16 Apr 2024 06:05:37 AM UTC.
Last metadata expiration check: 0:00:20 ago on Mon 17 Jun 2024 09:14:38 PM UTC.
--> Starting dependency resolution
---> Package setup.noarch 2.12.2-9.el8 will be upgraded
---> Package setup.noarch 2.12.2-11.el8 will be an upgrade
--> Finished dependency resolution
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                         Architecture                                     Version                                                   Repository                                        Size
===================================================================================================================================================================================================================
Upgrading:
 setup                                           noarch                                           2.12.2-11.el8                                             baseos                                           180 k

Transaction Summary
===================================================================================================================================================================================================================
Upgrade  1 Package

Total download size: 180 k
Downloading Packages:
setup-2.12.2-11.el8.noarch.rpm                                                                                                                                                     8.1 MB/s | 180 kB     00:00    
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                              7.7 MB/s | 180 kB     00:00     
Using rpmkeys executable at /usr/bin/rpmkeys to verify signatures
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                           1/1 
  Upgrading        : setup-2.12.2-11.el8.noarch                                                                                                                                                                1/2 
Error unpacking rpm package setup-2.12.2-11.el8.noarch
Errors occurred during transaction.
  Verifying        : setup-2.12.2-11.el8.noarch                                                                                                                                                                1/2 
  Verifying        : setup-2.12.2-9.el8.noarch                                                                                                                                                                 2/2 
Completion plugin: Generating completion cache...
Failed: setup-2.12.2-9.el8.noarch
Failed: setup-2.12.2-11.el8.noarch

Failed:
  setup-2.12.2-9.el8.noarch                                                                               setup-2.12.2-11.el8.noarch                                                                              

Error: Transaction failed

I then ran DNF with --downloadonly and ran RPM to verify the file.

[root@server1 ~]# rpm -vVp setup-2.12.2-11.el8.noarch.rpm 
.........  c /etc/aliases
.........  c /etc/bashrc
.........  c /etc/csh.cshrc
.........  c /etc/csh.login
.........    /etc/dnf/protected.d/setup.conf
.........  c /etc/environment
.........  c /etc/ethertypes
.........  c /etc/exports
.........  c /etc/filesystems
.........  c /etc/fstab
.........  c /etc/group
.........  c /etc/gshadow
.........  c /etc/host.conf
.........  c /etc/hosts
.........  c /etc/inputrc
.........  c /etc/motd
.........  c /etc/networks
.........  c /etc/passwd
.........  c /etc/printcap
.........  c /etc/profile
.........    /etc/profile.d
.........  c /etc/profile.d/csh.local
.........    /etc/profile.d/lang.csh
.........    /etc/profile.d/lang.sh
.........  c /etc/profile.d/sh.local
.........  c /etc/protocols
.........  c /etc/services
.........  c /etc/shadow
.........  c /etc/shells
.........  c /etc/subgid
.........  c /etc/subuid
.........    /usr/share/doc/setup
.........  d /usr/share/doc/setup/uidgid
.........    /usr/share/licenses/setup
.........  l /usr/share/licenses/setup/COPYING

I do have other servers running Rocky 8 and none of them have had this issue with the setup package. Normally I use our local internal mirror for installations, rsynced from the main servers, but also tried to do this via the main Rocky servers to remove any possibility of it being a bad file on my mirror or others. Also this has been going on since last week. The wait was to see if it a package update might be provided to fix it.
Thanks for any assistance.

Try:

dnf clean all
dnf update

to refresh repo data in case it’s a corrupted download.

That has been done a few times. First to see if the download was bad then again between repo swaps to find out if the issue was a corrupted file on the repo.

It’s now been 10 days since this started and the package still fails. Does anyone else have this issue?

When you say you reverted to Rocky mirrors, do you mean the repo files in etc/yum.repos.d are pointed to the mirrorlist option or did you also try hashing the mirrorlist and using the baseurl one as well? If not, I would suggest trying both but it’s definitely a weird one since so far only you seem to be having this problem, and only on one server too since your others were OK.

When I reverted to Rocky mirrors I modified the repo files to use the Rocky mirrorlist and commented out the baseurl option for my local mirror.
As for my other servers one other now has the same problem. Both are nearly identical hardware wise but I wouldn’t think the hardware would be the source of this issue.

I just did the following:

[root@rocky8 ~]# dnf download setup
setup-2.12.2-11.el8.noarch.rpm                                                     1.6 MB/s | 180 kB     00:00    

[root@rocky8 ~]# sha256sum setup-2.12.2-11.el8.noarch.rpm 
2c6d7af42502a950d018bc6ff2287a1540ec0176a24fb27dc9d2cd9b10beb4c8  setup-2.12.2-11.el8.noarch.rpm

[root@rocky8 ~]# dnf reinstall ./setup-2.12.2-11.el8.noarch.rpm 

Dependencies resolved.
===================================================================================================================
 Package                Architecture            Version                        Repository                     Size
===================================================================================================================
Reinstalling:
 setup                  noarch                  2.12.2-11.el8                  @commandline                  180 k

Transaction Summary
===================================================================================================================

Total size: 180 k
Installed size: 708 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                           1/1 
  Reinstalling     : setup-2.12.2-11.el8.noarch                                                                1/2 
  Running scriptlet: setup-2.12.2-11.el8.noarch                                                                1/2 
  Cleanup          : setup-2.12.2-11.el8.noarch                                                                2/2 
  Verifying        : setup-2.12.2-11.el8.noarch                                                                1/2 
  Verifying        : setup-2.12.2-11.el8.noarch                                                                2/2 
Installed products updated.

Reinstalled:
  setup-2.12.2-11.el8.noarch                                                                                       

Complete!

so I’ve downloaded it OK and (re)installed no problems. Can you use the dnf download setup command, and then compare the sha256sum from mine to see if it’s the same. That way we can tell if you are getting the correct package or not:

[root@rocky8 ~]# sha256sum setup-2.12.2-11.el8.noarch.rpm 
2c6d7af42502a950d018bc6ff2287a1540ec0176a24fb27dc9d2cd9b10beb4c8  setup-2.12.2-11.el8.noarch.rpm

the above was included in the full output, but I’ve pulled it out to make it easier. Maybe your network is doing weird things and corrupting it?

Doesn’t look like the issues are from downloading. I downloaded it using dnf and the sha256sum matches.

[root@server1 ~]# dnf download setup
setup-2.12.2-11.el8.noarch.rpm                                                                                                                                                     9.9 MB/s | 180 kB     00:00    
[root@server1 ~]# sha256sum setup-2.12.2-11.el8.noarch.rpm 
2c6d7af42502a950d018bc6ff2287a1540ec0176a24fb27dc9d2cd9b10beb4c8  setup-2.12.2-11.el8.noarch.rpm

Your issue appears to be isolated to your system(s). In your first post, it appears you have a lot of third party repos enabled.

This is what I would verify:

  • A package installed from a third party repo is deploying a file or directory that setup actually owns
  • A package installed from a third party repo is “owning” some file or directory from setup (you would get a different error, but this is still important to point out)
  • Someone or something is deploying/replacing a file that setup is supposed to own and manage

The exceptions to the above is anything marked as a “config” (anything that is c in rpm -vV.)

For what it is worth, I am also having this exact issue. I’m running an airgapped network, and I mirror the Rocky repo to transfer to the airgapped network. Confirmed that the hash matches the expected value; my error when trying to install direclty using rpm is:

error: unpacking of archive failed on file /etc/shadow;6690658f: cpio: rename failed - Directory not empty

Any thoughts from anyone on where to look next would be greatly appreciated!!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.