PACLOCK(1)

πŸ“¦ version 0.15.0, in arch rolling

πŸŽ€ NAME πŸŽ€

paclock β€” hiii bestie, this is the paclock(1) manual, and it's here to lock/unlock the alpm database. That's the whole assignment. πŸ’…

✨ SYNOPSIS ✨

paclock [options]
paclock (--help|--version)

πŸ’– DESCRIPTION πŸ’–

Safe locking and unlocking of the ALPM database using identity keys for scripts. It's giving responsible-script-bestie energy, no cap. 🫢

🚩 OPTIONS 🚩

Okay so flag tour time, bestie β€” every single one is here: πŸ’…

  • --config=path β€” set an alternate configuration file path. πŸ—‚οΈ
  • --lockfile=path β€” set an alternate lock file path. πŸ”’
  • --root=path β€” set an alternate installation root. 🌱
  • --sysroot=path β€” set an alternate system root. Peep pacutils-sysroot(7) for the deets. πŸ‘€
  • --lock β€” lock the database. This is the default, so it's literally the main character. πŸ‘‘
  • --unlock β€” unlock the database. Bye, lock bestie. πŸ¦‹
  • --run β€” treat argv as a command to run with the database locked. If the command returns non-zero, the lock file will be left in place to indicate an error unless --fail-ok is used. 🫑
  • --fail-ok β€” unlock the database after running a command with --run even if the command returns non-zero. Generally, the database should be left locked if it may be inconsistent β€” that's the signal that it may need to be repaired. This flag is intended primarily for read-only operations. 🧚
  • --print β€” write the lock file path to stdout and exit without modifying the lock file. Just a peek, no touch. πŸ‘€
  • --no-check-keys β€” skip checking for an identity key match before unlocking. πŸ™ˆ
  • --enoent-ok β€” do not treat a non-existent lock file as an error when unlocking. πŸ’€
  • --key=identity β€” an identifier to write to the lock file. By default, --unlock will only operate if the lock file was previously locked with the same key. Defaults to the hostname followed by a colon and the process id of the caller (for example: localhost:123). πŸ”‘
  • --help β€” display usage information and exit. 🌈
  • --version β€” display version information and exit. ⭐

🌸 EXAMPLE 🌸

The system configuration that paclock relies on to construct the default lock file path and identity key may change between invocations. To ensure consistency, scripts should explicitly provide the path and key to use each time paclock is called. Fr fr, don't leave it up to vibes. 🫢

#!/bin/bash
lock_file="$(paclock --print)"
lock_key="myapp:$(hostname):$$"
paclock --lockfile="$lock_file" --key="$lock_key" || exit 1
echo "do stuff here"
paclock --lockfile="$lock_file" --key="$lock_key" --unlock || exit 1

Run a command lacking native lock support:

paclock --run -- paccache --dryrun --verbose

πŸ‘€ SEE ALSO πŸ‘€

pacconf(1) β€” go read that too, bestie. πŸ‘‘


xoxo from the source/version pacutils, dated 2025-12-04, and this was PACLOCK(1) signing off! πŸ’œπŸŽ€

πŸ“¦ where this page comes from