Pacman

Welcome to the Pacman bug tracker. Please search the current bugs and feature requests before filing a new one! Use advanced search and select "Search in Comments".

* Please select the correct category and version.
* Write a descriptive summary, background info, and provide a reproducible test case whenever possible.
Tasklist

FS#67412 - Lockfile explanation missing when synchronizing databases

Attached to Project: Pacman
Opened by David Macek (Elieux) - Monday, 27 July 2020, 07:25 GMT
Task Type Feature Request
Category General
Status Unconfirmed
Assigned To No-one
Architecture msys
Severity Low
Priority Normal
Reported Version 5.2.1
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Summary and Info:

When pacman fails to acquire its exclusive lock during syncing dbs (-Sy), it doesn't give the same helpful message as when for example upgrading. It took me a few minutes to find out what kind of lock it's talking about because the result is the same as with denied permissions (this might be a specialty of the MSYS2 port though because there's no root account).

Steps to Reproduce:

$ pacman -Sy
:: Synchronizing package databases...
error: failed to update foo (unable to lock database)
error: failed to update bar (unable to lock database)
error: failed to update etc (unable to lock database)
error: failed to synchronize all databases

$ sudo touch /var/lib/pacman/db.lck

$ sudo pacman -Sy
:: Synchronizing package databases...
error: failed to update foo (unable to lock database)
error: failed to update bar (unable to lock database)
error: failed to update etc (unable to lock database)
error: failed to synchronize all databases

$ pacman -Su
error: failed to init transaction (unable to lock database)
error: could not lock database: File exists
if you're sure a package manager is not already
running, you can remove /var/lib/pacman/db.lck

$ sudo rm /var/lib/pacman/db.lck
This task depends upon

Comment by David Macek (Elieux) - Monday, 27 July 2020, 08:04 GMT
Oops, should've been `sudo pacman -Su` as the fourth command.
Comment by David Macek (Elieux) - Monday, 27 July 2020, 20:17 GMT
From IRC, allanbrokeit: really, we should just check we have a lock before doing anything and not report it fails for every database

Loading...