When rpm is run as a regular user while there's no %{dbpath}/.rpm.lock file in place yet, it tries to create one and when the path is non-writable by the user (which is typically the case), then the command fails with:
error: can't create transaction lock on /usr/lib/sysimage/rpm/.rpm.lock (No such file or directory)
While the lock file is normally put in place by the OS installer (e.g. Anaconda on Fedora) or shipped with a container image, it may happen to be missing e.g. after doing an rpmdb --rebuilddb.
We may want to handle this more gracefully, at least give a more user-friendly message.
When
rpmis run as a regular user while there's no%{dbpath}/.rpm.lockfile in place yet, it tries to create one and when the path is non-writable by the user (which is typically the case), then the command fails with:While the lock file is normally put in place by the OS installer (e.g. Anaconda on Fedora) or shipped with a container image, it may happen to be missing e.g. after doing an
rpmdb --rebuilddb.We may want to handle this more gracefully, at least give a more user-friendly message.