#1062190 packagekit: locks the dpkg frontened in the middle of a running update by synaptic package manager

Package:
packagekit
Source:
packagekit
Description:
Provides a package management service
Submitter:
Daniel Blaschke
Date:
2025-04-06 19:45:02 UTC
Severity:
normal
#1062190#5
Date:
2024-01-31 16:03:36 UTC
From:
To:
Dear Maintainer,

every other time when I install updates using the synaptic package manager, it
gets interrupted by packagekitd locking the dpkg frontend leading to error
messages like this one I got today:
Preparing to unpack .../locales_2.36-9+deb12u4_all.deb ...
Unpacking locales (2.36-9+deb12u4) over (2.36-9+deb12u3) ...
dpkg: error: dpkg frontend lock was locked by another process with pid 567573
Note: removing the lock file is always wrong, can damage the locked area
and the entire system. See <https://wiki.debian.org/Teams/Dpkg/FAQ#db-lock>.
E: Sub-process /usr/bin/dpkg returned an error code (2)
A package failed to install.  Trying to recover:
dpkg: error: dpkg frontend lock was locked by another process with pid 567573
Note: removing the lock file is always wrong, can damage the locked area
and the entire system. See <https://wiki.debian.org/Teams/Dpkg/FAQ#db-lock>.

This was the error message in synaptic package manager and when I looked up pid
567573 it turned out to be packagekitd

Please do not ever lock dpkg while it is in use by another program!

Thanks,
Daniel

#1062190#10
Date:
2024-01-31 16:15:41 UTC
From:
To:
Hi Julian (now CC'ed)!

Do you have any idea how this would be possible? Both PK and Synaptic
should hold the APT frontend lock, so they should never be able to run
at the same time.
I also have never once observed this behavior...

Cheers,
    Matthias

#1062190#15
Date:
2025-03-23 10:22:43 UTC
From:
To:
If packagekit checks for the lock (I assume you claim it does), isn't it
synaptics fault to not grab the lock? I.e. isn't this bug filed against
the wrong package?

Paul

#1062190#20
Date:
2025-04-04 21:55:32 UTC
From:
To:
Both synaptic and PackageKit need to support the frontend lock, I don't
know if they do, that may involve calling UnLockInner() rather than
UnLock(), and LockInner() rather than Lock() to regain released inner
locks in some places.

#1062190#25
Date:
2025-04-04 22:00:59 UTC
From:
To:
Control: reassign -1 synaptic
Control: retitle -1 synaptic: releases frontend lock while running dpkg

synaptic calls releaseLock() before running dpkg; which in turn calls
APT's UnLock(). I believe, but am not sure, that we can drop that call
entirely and APT should do the right thing.

I don't quite know and I'd need to do more investigation and a trial
and error attempt :D

#1062190#36
Date:
2025-04-06 16:25:58 UTC
From:
To:
On Sat, Apr 5, 2025, at 00:00, Julian Andres Klode wrote:
[..]

Thanks for the bugreport and the help diagnosing it!
I pushed a small change into https://github.com/mvo5/synaptic/commit/928ce5bd19bdd810a6920831a8d738d016edb2d8
that should fix it and will upload shortly.

Thanks,
 Michael

#1062190#41
Date:
2025-04-06 19:42:33 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
synaptic, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1062190@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Vogt <mvo@debian.org> (supplier of updated synaptic package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sun, 06 Apr 2025 21:12:43 +0200
Source: synaptic
Architecture: source
Version: 0.91.7
Distribution: unstable
Urgency: medium
Maintainer: Michael Vogt <mvo@debian.org>
Changed-By: Michael Vogt <mvo@debian.org>
Closes: 1062190
Changes:
 synaptic (0.91.7) unstable; urgency=medium
 .
   * common: use `_system->{,Un}LockInner()`
     (Closes: #1062190)
Checksums-Sha1:
 b435c3cfeae3eb7c2b7293d4fdf1f36d5817a4c7 1682 synaptic_0.91.7.dsc
 81a5f6f73d8f64224fd79b199b5b511fb3afdb94 2383500 synaptic_0.91.7.tar.xz
 8af5cb9575d24409cc98bd63f34870f6b1adc952 16633 synaptic_0.91.7_source.buildinfo
Checksums-Sha256:
 2bd1a670d52e593627a8cc5b99be174892d5fa652e1a3967fcac5ab2c0b9de4f 1682 synaptic_0.91.7.dsc
 480bbdc0d98a5a3c7937c693c8023dd2058e7785baa44d0f52f54aa0be621f37 2383500 synaptic_0.91.7.tar.xz
 45e574a18857d6d44ea4f1c7fe0a71d829f2226370c36d1d3f734e915e9be0df 16633 synaptic_0.91.7_source.buildinfo
Files:
 2536c2fcfd3a5eca3f51b2ccb1740011 1682 admin optional synaptic_0.91.7.dsc
 cb03ca043bfb78123780ea0e9e6b4004 2383500 admin optional synaptic_0.91.7.tar.xz
 c1aa85f889d0d244f13a0f9a3ab715b5 16633 admin optional synaptic_0.91.7_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE2mxnVNiIdibNBqEomMq7Or1MpZ4FAmfy0nYACgkQmMq7Or1M
pZ5AqA//U5XLXXmZy2dWLoHHP6bHUY5C0MVqhxkCkTPMjU1QQNfzEYIX1mb0oA2y
B6ZSwJmTLSYLZDb4Mbpd1RMyU/WxETH9q/t+gF9n55ZSpkwjLcjCPVK24odFFQVL
tNyQTFYVa2i+y/A+LASJonbSCt7adpgXe6MvcxGNhq6lGoEMfpT5ZAAYCEvA96FQ
uftUotd/xEIJ4VZBuhkH57fP89pk5kSNd3jkM/pLlgvoPIU+J8zlcEkinWQ/Yp/a
/uG13mNdeqWcTaNoiajC80LdOoi/4VY7AHVWh0oV+eTZs0ENybfHpBjbkQM4S60+
kscvopmJCrqtdn5J6W3SlRjmJbgn7TT2mz7fmYvFkFbn0bD89Rx81X7O9SKYokjZ
OMCvP3s8wb/9uINwWzt0wtKjvRTJDnJXaUAOtUW2COhWqEf3rp8SgIMUbukuwim4
UeUrkQZ7BCObHyrr+vmPiAwZmEEYQ1pygxfyqonPkWIGQEgHNs/VLj4kij3VGQK1
qgeZm1EWeamMoBPddYfkXeHvz4LJSUnDX0Q+ClodxbLgs3hJO3hYe5Gngf8kZeMT
xMUI+mVQxE+6iG7YyBY54Og7xW3CmFZVnY5LyxmvsfxS8waCH4RmVfZ5FJ950rMu
gEOjvbDHrgWRXY9RnjuQ0Hxxj9smw4ItRK57VRLlx5otfoRdQpA=
=Kw0W
-----END PGP SIGNATURE-----