Discussion:
Bug#850417: dpkg: error: dpkg status database is locked by another process
(too old to reply)
Vincent Lefevre
2017-01-06 10:40:02 UTC
Permalink
Raw Message
Package: dpkg
Version: 1.18.18
Severity: grave
Justification: renders package unusable

When I tried to upgrade from aptitude:

Performing actions...
Retrieving bug reports... Done
Parsing Found/Fixed information... Done
Retrieving bug reports... Done
Parsing Found/Fixed information... Done
Reading changelogs... Done
apt-listchanges: Do you want to continue? [Y/n]
(Reading database ... 509222 files and directories currently installed.)
Preparing to unpack .../libapt-pkg5.0_1.4~beta3_amd64.deb ...
Unpacking libapt-pkg5.0:amd64 (1.4~beta3) over (1.4~beta2) ...
Setting up libapt-pkg5.0:amd64 (1.4~beta3) ...
dpkg: error: dpkg status database is locked by another process
====== How can you help? (doc: https://wiki.debian.org/how-can-i-help ) ======

----- Show old opportunities as well as new ones: how-can-i-help --old -----
E: Sub-process /usr/bin/dpkg returned an error code (2)
Processing triggers for libc-bin (2.24-8) ...
Press Return to continue, 'q' followed by Return to quit.

The only other process matching apt and dpkg is aptitude itself.

-- System Information:
Debian Release: stretch/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-2-amd64 (SMP w/12 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dpkg depends on:
ii libbz2-1.0 1.0.6-8
ii libc6 2.24-8
ii liblzma5 5.2.2-1.2
ii libselinux1 2.6-3
ii tar 1.29b-1.1
ii zlib1g 1:1.2.8.dfsg-4

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii apt 1.4~beta2

-- no debconf information
Vincent Lefevre
2017-01-06 11:10:02 UTC
Permalink
Raw Message
Some additional information... In the /var/log/dpkg.log file:

2017-01-06 11:24:37 startup archives unpack
2017-01-06 11:24:38 upgrade libapt-pkg5.0:amd64 1.4~beta2 1.4~beta3
2017-01-06 11:24:38 status triggers-pending libc-bin:amd64 2.24-8
2017-01-06 11:24:38 status half-configured libapt-pkg5.0:amd64 1.4~beta2
2017-01-06 11:24:38 status unpacked libapt-pkg5.0:amd64 1.4~beta2
2017-01-06 11:24:38 status half-installed libapt-pkg5.0:amd64 1.4~beta2
2017-01-06 11:24:38 status half-installed libapt-pkg5.0:amd64 1.4~beta2
2017-01-06 11:24:38 status unpacked libapt-pkg5.0:amd64 1.4~beta3
2017-01-06 11:24:38 status unpacked libapt-pkg5.0:amd64 1.4~beta3
2017-01-06 11:24:38 startup packages configure
2017-01-06 11:24:38 configure libapt-pkg5.0:amd64 1.4~beta3 <none>
2017-01-06 11:24:38 status unpacked libapt-pkg5.0:amd64 1.4~beta3
2017-01-06 11:24:38 status half-configured libapt-pkg5.0:amd64 1.4~beta3
2017-01-06 11:24:38 status installed libapt-pkg5.0:amd64 1.4~beta3
2017-01-06 11:24:40 startup packages configure
2017-01-06 11:24:40 trigproc libc-bin:amd64 2.24-8 <none>
2017-01-06 11:24:40 status half-configured libc-bin:amd64 2.24-8
2017-01-06 11:24:40 status installed libc-bin:amd64 2.24-8

The timestamp of /var/lib/dpkg/lock is: 2017-01-06 11:24:40
--
Vincent Lefèvre <***@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Vincent Lefevre
2017-01-06 11:20:01 UTC
Permalink
Raw Message
On 2017-01-06 12:05:19 +0100, Vincent Lefevre wrote:
[...]
Post by Vincent Lefevre
2017-01-06 11:24:38 status installed libapt-pkg5.0:amd64 1.4~beta3
2017-01-06 11:24:40 startup packages configure
2017-01-06 11:24:40 trigproc libc-bin:amd64 2.24-8 <none>
2017-01-06 11:24:40 status half-configured libc-bin:amd64 2.24-8
2017-01-06 11:24:40 status installed libc-bin:amd64 2.24-8
The timestamp of /var/lib/dpkg/lock is: 2017-01-06 11:24:40
In the /var/log/apt/history.log file:

Start-Date: 2017-01-06 11:24:37
Upgrade: libapt-inst2.0:amd64 (1.4~beta2, 1.4~beta3), apt:amd64 (1.4~beta2, 1.4~beta3), python-apt-common:amd64 (1.1.0~beta5, 1.4.0~beta1), libapt-pkg5.0:amd64 (1.4~beta2, 1.4~beta3), python-lxml:amd64 (3.6.4-1, 3.7.1-1), apt-doc:amd64 (1.4~beta2, 1.4~beta3), python-apt:amd64 (1.1.0~beta5, 1.4.0~beta1), apt-utils:amd64 (1.4~beta2, 1.4~beta3), python-numpy:amd64 (1:1.12.0~b1-1, 1:1.12.0~rc2-1), python3-apt:amd64 (1.1.0~beta5, 1.4.0~beta1)
Error: Sub-process /usr/bin/dpkg returned an error code (2)
End-Date: 2017-01-06 11:24:38

In the /var/log/apt/term.log file:

Log started: 2017-01-06 11:24:37
(Reading database ... ^M(Reading database ... 5%^M(Reading database ... 10%^M(Reading database ... 15%^M(Reading database ... 20%^M(Reading database ... 25%^M(Reading database ... 30%^M(Reading database ... 35%^M(Reading database ... 40%^M(Reading database ... 45%^M(Reading database ... 50%^M(Reading database ... 55%^M^M(Reading database ... 60%^M(Reading database ... 65%^M(Reading database ... 70%^M(Reading database ... 75%^M(Reading database ... 80%^M(Reading database ... 85%^M(Reading database ... 90%^M(Reading database ... 95%^M(Reading database ... 100%^M(Reading database ... 509222 files and directories currently installed.)
Preparing to unpack .../libapt-pkg5.0_1.4~beta3_amd64.deb ...
Unpacking libapt-pkg5.0:amd64 (1.4~beta3) over (1.4~beta2) ...
Setting up libapt-pkg5.0:amd64 (1.4~beta3) ...
dpkg: error: dpkg status database is locked by another process
Log ended: 2017-01-06 11:24:38
--
Vincent Lefèvre <***@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Vincent Lefevre
2017-01-06 12:50:01 UTC
Permalink
Raw Message
Control: severity -1 normal
Hi!
Post by Vincent Lefevre
Package: dpkg
Version: 1.18.18
Severity: grave
Justification: renders package unusable
I don't think this severity is right here, at least for dpkg, but
let's see.
Lowering to normal since after several upgrades, I can't reproduce the
problem.
I'm assuming that cannot easily reproduce the problem?
I couldn't reproduce it yet.
That the system probably has some unnattended async calls to a
command that locks the dpkg database?
Such as? In any case, there is nothing in the dpkg/apt logs that
would suggest that.

In the journalctl logs at this time, I only have:

Jan 06 11:24:38 cventin systemd[1]: Reloading.
Jan 06 11:24:38 cventin systemd[1]: apt-daily.timer: Adding 8h 48min 32.153121s random time.
Jan 06 11:24:38 cventin systemd[1]: Reloading.
Jan 06 11:24:38 cventin systemd[1]: apt-daily.timer: Adding 11h 35min 4.281611s random time.
Jan 06 11:24:38 cventin systemd[1]: Stopped Daily apt activities.
Jan 06 11:24:38 cventin systemd[1]: Stopping Daily apt activities.
Jan 06 11:24:38 cventin systemd[1]: apt-daily.timer: Adding 5h 4min 59.261844s random time.
Jan 06 11:24:38 cventin systemd[1]: Started Daily apt activities.
Jan 06 11:24:38 cventin systemd[1]: Starting Daily apt activities...
Jan 06 11:24:40 cventin systemd[1]: Started Daily apt activities.
Jan 06 11:24:40 cventin systemd[1]: apt-daily.timer: Adding 10h 35min 58.916108s random time.
Jan 06 11:24:40 cventin systemd[1]: apt-daily.timer: Adding 9h 54min 24.332138s random time.

This is due to the apt upgrade, I assume. This looks strange, though:
e.g. Started, then Starting, then Started.
Either that, or if it's a multi-admin system perhaps someone else
started an aptitude instance just between the time apt/aptitude
release the dpkg lock so that dpkg itself can take it?
No, I'm the only user (and admin) of the machine.
--
Vincent Lefèvre <***@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Debian Bug Tracking System
2017-01-06 12:50:01 UTC
Permalink
Raw Message
Post by Vincent Lefevre
severity -1 normal
Bug #850417 [dpkg] dpkg: error: dpkg status database is locked by another process
Severity set to 'normal' from 'grave'
--
850417: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=850417
Debian Bug Tracking System
Contact ***@bugs.debian.org with problems
Loading...