Read-only lock on /var/lib/rpm/.rpm.lock

I have been running Tumbleweed for about a year. The odd issues after an upgrade I have managed to fix easily, but now the boot routine goes into emergency mode. I can boot successfully from a previous snapshot but cannot upgrade or install anything because the process fails with the message: Subprocess failed. Error: RPM failed: error: can’t create transaction lock on /var/lib/rpm/.rpm.lock (Read-only file system).

I have run smartctl on the SSD system disc (less than a year old) but it reports no errors. I believe the problem may have started from when I returned home to find the computer had apparently switched itself off. There was no sign of a power cut and the UPS would have protected it anyway.

I can find no way to remove the read-only flag on this file, or even delete it. I would be very grateful for any help.

Thanks in advance


Previous snapshot is read-only by definition. If you want to continue to use it, you need to perform rollback which clones read-only snapshot into writable subvolume and sets this subvolume as new system root. Surprisingly, this is even documented reasonably well, there is whole chapter dedicated to recovery from snapshots; and when you boot from previous snapshot system should actually have displayed a hint how to perform rollback.

Oh dear, I am ashamed to say this is yet another case of RTFM. Nevertheless, thank you arvidjaar for responding so quickly to such an elementary question; I am very grateful. If anybody else turns up this thread on a search, I found the document “BTRFS and Rollback” by Thorsten Kukuk very useful.

Kind regards,