I believe this issue occurred because I upgraded from Fedora 39 to 41. Running dnf update after the upgrade updated about 500 packages (upgraded a while ago, but I think this is the first time I’m running dnf update since then), however not all of them successfully. Some failed during the “[3/4] Installing” phase with the error “Invalid argument”, see below for the full output of dnf.
I have removed all offending packages and tried to install them again which resulted in the same error, also after restarting the system. However, before removing them I ran restorecon -v <path_to_executeable> which also resulted in that “Invalid argument” error which I can’t explain. The file exists but restorecon was unable to change it’s selinux label? Never had this happen, though I’m not an expert in selinux.
Please help me fix this. I have seen this issue with these packages: podman, passt, swtpm and some docker packages which i have removed and don’t need anymore.
Here is the dnf log for installing podman:
Updating and loading repositories:
Repositories loaded.
Package Arch Version Repository Size
Installing:
podman x86_64 5:5.4.0-1.fc41 updates 49.4 MiB
Installing dependencies:
conmon x86_64 2:2.1.12-3.fc41 fedora 166.4 KiB
Transaction Summary:
Installing: 2 packages
Total size of inbound packages is 16 MiB. Need to download 0 B.
After this operation, 50 MiB extra will be used (install 50 MiB, remove 0 B).
Is this ok [y/N]: y
[1/2] podman-5:5.4.0-1.fc41.x86_64 100% | 0.0 B/s | 0.0 B | 00m00s
>>> Already downloaded
[2/2] conmon-2:2.1.12-3.fc41.x86_64 100% | 0.0 B/s | 0.0 B | 00m00s
>>> Already downloaded
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[2/2] Total 100% | 0.0 B/s | 0.0 B | 00m00s
Running transaction
[1/4] Verify package files 100% | 54.0 B/s | 2.0 B | 00m00s
[2/4] Prepare transaction 100% | 4.0 B/s | 2.0 B | 00m00s
[3/4] Installing conmon-2:2.1.12-3.fc41.x86_64 100% | 10.9 MiB/s | 167.8 KiB | 00m00s
>>> [RPM] lsetfilecon: (40 /usr/bin/conmon;67c3aaa2, system_u:object_r:conmon_exec_t:s0) Invalid argument
>>> [RPM] Plugin selinux: hook fsm_file_prepare failed
>>> [RPM] unpacking of archive failed on file /usr/bin/conmon;67c3aaa2: cpio: (error 0x2)
>>> Unpack error: conmon-2:2.1.12-3.fc41.x86_64
[1/4] Installing podman-5:5.4.0-1.fc41.x86_64 100% | 489.0 MiB/s | 49.4 MiB | 00m00s
>>> [RPM] conmon-2:2.1.12-3.fc41.x86_64: install failed
>>> [RPM] lsetfilecon: (40 /usr/bin/podman;67c3aaa2, system_u:object_r:container_runtime_exec_t:s0) Invalid argument
>>> [RPM] Plugin selinux: hook fsm_file_prepare failed
>>> [RPM] unpacking of archive failed on file /usr/bin/podman;67c3aaa2: cpio: (error 0x2)
>>> Unpack error: podman-5:5.4.0-1.fc41.x86_64
Transaction failed: Rpm transaction failed.