Friday, August 10, 2018

dpkg - Why does apt not display an error message even if flock is used?

Running script



#!/bin/bash
(
flock 9
# ... commands executed under lock ...
fuser -v /var/lib/dpkg/lock
apt-get -f --assume-no install
) 9>/var/lib/dpkg/lock



as superuser does not display an error message. But if there is e.g. synaptic running,apt-get will display an error message:
"E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)".

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...