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