* Michael Prokop [Mon Jul 07, 2014 at 04:59:47PM +0200]:

> apt-get immediately returns with an error if the lock file
> (/var/lib/dpkg/lock) can't be locked.

> It would be nice, if apt-get could provide an option for a timeout
> option to retry locking the file before actually giving up; similar
> to what reprepro(1) is providing with its --waitforlock's option:
[...]
> It's not uncommon in certain setups that a monitoring check executes
> apt-get actions while another script (cron, config management,...)
> tries to execute another apt-get action in parallel. Either of them
> then sadly fails and causes unneeded overhead.

With bad timing as I just had it this might be even an issue during
ongoing package installation and in between monitoring checks
showing up, causing the installation procedure to fail in the
middle:

,---- [ c/p ]
| # apt-get install linux-image-amd64
| Reading package lists... Done
| Building dependency tree
| Reading state information... Done
| The following extra packages will be installed:
|   linux-image-3.14-0.bpo.1-amd64
| Suggested packages:
|   linux-doc-3.14 debian-kernel-handbook
| Recommended packages:
|   firmware-linux-free
| The following NEW packages will be installed:
|   linux-image-3.14-0.bpo.1-amd64
| The following packages will be upgraded:
|   linux-image-amd64
| 1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
| Need to get 30.9 MB of archives.
| After this operation, 146 MB of additional disk space will be used.
| Do you want to continue [Y/n]?
| Get:1 http://debian.[snip]/debian/ wheezy-backports/main 
linux-image-3.14-0.bpo.1-amd64 amd64 3.14.7-1~bpo70+1 [30.9 MB]
| Get:2 http://debian.[snip]/debian/ wheezy-backports/main linux-image-amd64 
amd64 3.14+57~bpo70+1 [6,118 B]
| Fetched 30.9 MB in 3s (8,814 kB/s)
| Preconfiguring packages ...
| Selecting previously unselected package linux-image-3.14-0.bpo.1-amd64.
| (Reading database ... 46414 files and directories currently installed.)
| Unpacking linux-image-3.14-0.bpo.1-amd64 (from 
.../linux-image-3.14-0.bpo.1-amd64_3.14.7-1~bpo70+1_amd64.deb) ...
| Preparing to replace linux-image-amd64 3.2+46 (using 
.../linux-image-amd64_3.14+57~bpo70+1_amd64.deb) ...
| Unpacking replacement linux-image-amd64 ...
| dpkg: error: dpkg status database is locked by another process
| E: Sub-process /usr/bin/dpkg returned an error code (2)
| apt-get install linux-image-amd64  4.40s user 1.24s system 53% cpu 10.481 
total
`----

regards,
-mika-

Attachment: signature.asc
Description: Digital signature

Reply via email to