Recently I've been having the issue that some rpm commands (e.g.
# rpm --rebuilddb fail due to this error:
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
It also seems this affects PackageKit as whenever I try to open GNOME Software's updates tab it says "Timeout was reached".
To me, it seems like some rpm transaction was aborted while running and now the lock file is stuck there. I would just remove the file, but I'm not sure how to tell whether it's safe.
[neboula@shock ~]$ file /var/lib/rpm/.rpm.lock /var/lib/rpm/.rpm.lock: empty [neboula@shock ~]$ pidof dnf [neboula@shock ~]$ pidof rpm
This looks like it's safe, but I also have packagekitd (always) running, so I'm wondering: How can I safely remove this file given my circumstances?