On 17.03.2021 08:26, Andrei Borzenkov wrote:
On 17.03.2021 05:41, L A Walsh wrote:
On 2021/03/16 11:40, Andrei Borzenkov wrote:
On 16.03.2021 20:26, L A Walsh wrote:
mv: inter-device move failed: 'var/lib/rpm/alternatives' to 'usr/lib/sysimage/rpm/alternatives'; unable to remove target: Directory not empty; rmdir: failed to remove 'var/lib/rpm': Directory not empty
This means you have both non-empty /var/lib/rpm/alternatives/ and /usr/lib/sysimage/rpm/alternatives/. Well, that is something that does not happen normally. You are not even supposed to have both *directories* /var/lib/rpm and /usr/lib/sysimage/rpm at the same time.
And what exactly is not clear in this message? Mon Nov 20 14:50:53 UTC 2017 - mpluskal@suse.com - Move update alternatives database to new location
I was semi-expecting the rpm-db to move at some point, but how that got turned into a failed move of 'alternatives' wasn't exactly clear to me.
At some point alternatives database was kept under /var/lib/rpm, later it was moved into /var/lib/alternatives. This directory belongs to update-alternatives package and this package was responsible for relocating it.
Apparently transition from /var/lib/rpm to /usr/lib/sysimage/rpm happened after update-alternatives database was already in new location, so script that relocates RPM database does not expect directories nor attempts to move them. Although it is strange when we look at change dates, as RPM happened before update-alternatives ...
Thu Oct 26 12:10:16 UTC 2017 - rbrown@suse.com
- Remove usr-lib-rpmdb.patch - Add usr-lib-sysimage-rpm.patch to locate rpmdb to /usr/lib/sysimage/rpm after discussions with upstream - Migrates existing rpmdb in /var/lib/rpm to /usr/lib/sysimage/rpm
My guess is that both changes happened to be released together, probably in one snapshot, and update-alternatives migrates its database in postinstall script and RPM - in posttrans script, so it passed unnoticed.
I was wrong, script works correctly as long as /usr/lib/sysimage/rpm does not exist when conversion happens. It also moves /var/lib/rpm/alternatives.