-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
CentOS Stream 10
-
No
-
None
-
rhel-swm
-
0
-
False
-
False
-
-
None
-
None
-
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
All
-
None
There is a logics error in %posttrans script of rpm-4.19.1.1-17.el10 causing rpmdb-migrate.service to run on next boot (errorously) and rpmdb-migrate.service fails because migrate has already been run.
This patch demonstrates the issue (with fix).
Because there is a symlink /var/lib/rpm -> /usr/lib/sysimage/rpm, [ -d /var/lib/rpm ] is successful. And because there is no check for /var/lib/rpm being link, migration is wrongly triggered again.
Author: Tuomo Soini <tis@foobar.fi> Date: Thu Jun 12 11:26:41 2025 +0300 Fix posttrans logics diff --git a/rpm.spec b/rpm.spec index 40ad12c..17a288c 100644 --- a/rpm.spec +++ b/rpm.spec @@ -467,7 +467,8 @@ if [ -x /usr/bin/systemctl ]; then fi %posttrans -if [ -d /var/lib/rpm ]; then +# If already symlinked, migration is not possible +if [ ! -L /var/lib/rpm ] && [ -d /var/lib/rpm ]; then touch /var/lib/rpm/.migratedb fi if [ ! -d /var/lib/rpm ] && [ -d /usr/lib/sysimage/rpm ] && [ ! -f /usr/lib/sysimage/rpm/.rpmdbdirsymlink_created ]; then