Closed berlin2123 closed 2 years ago
migrate2rocky is refusing to continue because a pre-check of your rpm db is showing issues. You must fix the issues shown first as any attempt to migrate while your system is in this state can cause much worse problems.
This is usually caused by stopping a dnf (or yum) operation while it is happening (eg: by force-killing it, a power outage or dnf crashing somehow). This can often-times be repaired with the package-cleanup utility in the yum-utils package, otherwise you will need to manually go through all the problematic packages and remove one of each from the rpm db (with rpm -e --justdb ...) and with 261 problems to deal with that can be quite a lot so hopefully package-cleanup will work.
Good Luck
@pajamian Thanks a lot.
It is solved by the following for my node
dnf check | awk '{print $1}' > list
cat list | xargs rpm -e --justdb
In fact, this issue has nothing to do with migrating from centos8.5 to rocky8.6. After fixing the rpm db issue, the migration from centos8.5 to rocky8.6 works fine.
Just one more thing you should be aware of, although it's not likely to be an issue at this stage.
the rpm command you used just removes the package entry from the rpm db, it doesn't actually remove the files from your system. This is what you really want because if it removed the files it would corrupt the package you were trying to leave behind, but the thing is while the newer version of each package was left behind in the db you don't know for sure which version of the package's files were left on your system. Each package could have the older versioned files, or the newer ones, or even possibly a combination of both.
Now the reason why this probably isn't an issue for you now is because migrate2rocky will have run a distro-sync during the migration. This will have effectively swapped out each package on the system (and its associated files) for the Rocky Linux version, so all of those packages files will now be up to date with the latest version from Rocky Linux.
Where this can be an issue, however, is for packages in 3rd-party repos. If any of those packages were part of the duplicated, corrupted ones then the distro-sync will not necessarily have seen a need to replace them, and so you may still have the files from some 3rd-party repo packages that are the older, incorrect version. You can use the rpm -V (verify) command to verify the integrity of the files from those packages (see the rpm man page), and if you see any corruption simply reinstall the affected package(s).
Glad you got it working, though.
Some of my Centos 8.5 is migrated to rocky 8.5 before the release of rocky 8.6. However, now, after the release of rockylinux 8.6, can not migrate from Centos 8.5 by the same method anymore?