Bug#1135601: marked as done (apt: Add stale lock removal hint for users)

"Debian Bug Tracking System" <[email protected]> Sun, 03 May 2026 12:47:02 +0000
Newsgroups gmane.linux.debian.apt.devel
Message-ID <handler.1135601.D1135601.17778123061063223.ackdone@bugs.debian.org>
This is a multi-part message in MIME format...

------------=_1777812422-1063555-0
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"

Your message dated Sun, 3 May 2026 14:37:03 +0200
with message-id <[email protected]>
and subject line Re: Bug#1135601: apt: Add stale lock removal hint for users
has caused the Debian Bug report #1135601,
regarding apt: Add stale lock removal hint for users
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


--=20
1135601: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D1135601
Debian Bug Tracking System
Contact [email protected] with problems

------------=_1777812422-1063555-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at submit) by bugs.debian.org; 3 May 2026 11:55:07 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
	(2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-14.7 required=4.0 tests=BAYES_00,
	BODY_INCLUDES_PACKAGE,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,
	DKIM_VALID_EF,FREEMAIL_FROM,HAS_PACKAGE,HTML_MESSAGE,
	RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham
	autolearn_force=no version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 43; hammy, 84; neutral, 33; spammy, 0.
	spammytokens: hammytokens:0.000-+--aptpkg, 0.000-+--apt-pkg,
	0.000-+--UD:c_str, 0.000-+--Errno, 0.000-+--errno
Return-path: <[email protected]>
Received: from mail-qv1-xf29.google.com ([2607:f8b0:4864:20::f29]:40559)
	by buxtehude.debian.org with esmtps (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128)
	(Exim 4.96)
	(envelope-from <[email protected]>)
	id 1wJVPe-004LT1-2b
	for [email protected];
	Sun, 03 May 2026 11:55:07 +0000
Received: by mail-qv1-xf29.google.com with SMTP id 6a1803df08f44-8acaec91c6bso3849416d6.2
        for <[email protected]>; Sun, 03 May 2026 04:55:06 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1777809304; cv=none;
        d=google.com; s=arc-20240605;
        b=W5RELJuQQJnpEeFjmSlAOQcY4X6D/E5GvbFHHYE8iNXtO4Epv8A0p4vK+6pFmARTG0
         Cuj6VjsVomsi46VRPtrADA0goabxNPOo/H9now4IPw4mq9q64ZeRK3vcpWqScvpDkdzf
         2uo4nFRrb+Ug443Pz1pKNDA4hss4bkWXgkk3B9qZLvRGWlO1v6GrS3oa1lMsaH0/UyEJ
         dmVmsYBDOSstlG5S8mLeLU4lComjrgv7hH8La1LJoUFSwofgelTEcDAFUw5kXFn9w4wF
         Pa7pzpFocN+nkpnUtPILzb8mZZczB3aEV3vHGeySGc/0NByb51osfFzJRaK/ZmjpmRzp
         UNEg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
        h=to:subject:message-id:date:from:mime-version:dkim-signature;
        bh=JG5kYiJtIKfmZPKTc2LL4XIOMPqePlhdRs6i9w0vgWM=;
        fh=lIR/7veID2U00tj1D35G+ANF85YwqTAbTuNH/WGncTs=;
        b=fQQJkuAxuUw8zAbpOiodGHsQUbM2bJVDv/LvMHd8hVtPnYKE+8WlOfsDKntLBctNZO
         mMmjPqOmWFpgo8T+qR6i05GLbQvMNfE3b93j7ujICOV4YBDD9XoLD5n+9U4LpZscaGgC
         5PwPVMnupaw8NoJ8CHn6CVDt5ESaD6AJMQ0uk3aRa18WCqqcWE10VB6kiFUKlqJKOxqF
         3mCr6I8PqSPVbU+WLVX8CxXolJeuxIYcZBQiDjGQr46C3GHye/5qy0pjUjYidKYL9IB8
         3dzZ1wQ4DOppOjNmRDR7/Ao6PSmgKEoocIjSxjkLJHelN4CzFufnGzK+XII2RkGYcjnj
         iu3w==;
        darn=bugs.debian.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1777809304; x=1778414104; darn=bugs.debian.org;
        h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=JG5kYiJtIKfmZPKTc2LL4XIOMPqePlhdRs6i9w0vgWM=;
        b=LeFJdKHBWZTtPAcXrPATcbd2AGAHZDnGVmuPhBu03q+J9/9hThU+f4MmQTUHm1Vg2F
         S2AKab3dDGXK9zUPxh07BDOLa/Elzsi+GfWZXY6gbzZYFTc/O1VMZESV5yWjP0fxOy6z
         7AGmnkrz8YkpxQg7LpOo18HzQ+eNYv42ifb5R0xeK9XCJryYg9+CJg2+itynj9lfzcWm
         ZdKBBGBWdDiadfy/b2kudwhhQc0pLjfGyWagFlxRq5R7wDZQVT1LbL+ItXv4w6cQqcCi
         sm830KbHciytI/NiBdsnSaXrD3YR9YF7cOXk1kzPO7XnrR3MZhZQG2Wttw/nGN/J7E6j
         2dsg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1777809304; x=1778414104;
        h=to:subject:message-id:date:from:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=JG5kYiJtIKfmZPKTc2LL4XIOMPqePlhdRs6i9w0vgWM=;
        b=sbAUCodNOzYmwfb5NFP2WD6xwEXoEfcY2WKI+3q2wPgelBtyw/sD03go6BibaEVm3w
         WQH5ftOv16UnvitApvQUOQOuogI0ZFAt/baTyEXTAjQH47WwuUo3J57SoThcRo6/m4Qn
         vaW0WOW3X4nCgjhvxaLYUSzW310kUkbkIJJGqC3YviqzlgBkZqeapM2BAd9QKhFyH8tw
         LiLDHwdC+RKcC4sRbAS+GS30zMaNFzeJfvguxoTkaCKnPF0NBb89tuI9DcH+Ehrfy9nB
         Ck9NEBZVHyEXdWQdoZPiSUHaxtYOQBZKu6tqhg59JVvsf0EVaxu+u5tagGlZ6bjZyRAR
         ggng==
X-Gm-Message-State: AOJu0YySSUmoGJipyEVQVIy6BXVOLpixgOHeQKao5mOW1Dsya3+FdfTL
	c277wMBkXuQLwl2bjTQeZuUVyPFCmdlu22VGcuY3kHg5uT0cEg+uWEsNgbnvIflJqEXjdtx16xi
	xN5XXI5x/HN+nyeLZqmRko4kNf/E6pC2Lv2EY
X-Gm-Gg: AeBDies+q1VKcm1QaJ86HWt6ifv8CmDvK3RkqNt++3Rb6fu+4kBMKKFfsBLsJWuUk7Z
	hoGmfIQC8MhNRbY5fE4+u9UpCfM5vihTOw35a2zCNyRM2iaf8J4OsBRuWHmBYOn3l+apSwwi76P
	vvZn5cdqw73F7Pna/v8I8DbYJitYe6PT3h4E63nBDuOFFwmboDXsF8rGx3NbpHd9l8iu99E9ieY
	kgLwdpT66j1OGUy2UKoKO0F52zNQqW7FNx7PlIibNMzfaNZqMlBtwOpORyM/dF5vLE2j6kWb0nm
	zyN7IBaAlZI9Q8zRVkFdGQVSJ6dWog6pjFuR40MuCG1oLd0N5X2L
X-Received: by 2002:a05:6214:2602:b0:8b1:f5da:f7df with SMTP id
 6a1803df08f44-8b668922d62mr69193976d6.6.1777809304019; Sun, 03 May 2026
 04:55:04 -0700 (PDT)
MIME-Version: 1.0
From: Ashwin Gundarapu <[email protected]>
Date: Sun, 3 May 2026 17:24:27 +0530
X-Gm-Features: AVHnY4KkRUiynkDi04zzvnlFo6Uywt6Z0tEIUVkUYzhbg562AfZIDfcJau1t_-Y
Message-ID: <CANAeh8dGDPif3_HSPj0-vGjcT9Uutq5atzU9cQ9ByuqjZsrcqQ@mail.gmail.com>
Subject: apt: Add stale lock removal hint for users
To: [email protected]
Content-Type: multipart/mixed; boundary="0000000000000b7f2b0650e87cf5"
Delivered-To: [email protected]

--0000000000000b7f2b0650e87cf5
Content-Type: multipart/alternative; boundary="0000000000000b7f2a0650e87cf3"

--0000000000000b7f2a0650e87cf3
Content-Type: text/plain; charset="UTF-8"

Package: apt
Severity: wishlist
Tags: patch

When apt encounters a stale lock file with no owning process,
it warns users not to remove it but gives no actionable advice.
This patch adds a clear hint with the exact command to run.

--0000000000000b7f2a0650e87cf3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Package: apt<br>Severity: wishlist<br>Tags: patch<br><br>W=
hen apt encounters a stale lock file with no owning process,<br>it warns us=
ers not to remove it but gives no actionable advice.<br>This patch adds a c=
lear hint with the exact command to run.</div>

--0000000000000b7f2a0650e87cf3--
--0000000000000b7f2b0650e87cf5
Content-Type: text/x-patch; charset="US-ASCII"; name="apt-stale-lock-hint.patch"
Content-Disposition: attachment; filename="apt-stale-lock-hint.patch"
Content-Transfer-Encoding: base64
Content-ID: <f_moppptue0>
X-Attachment-Id: f_moppptue0

LS0tIGFwdC0zLjMuMC1vcmlnaW5hbC9hcHQtcGtnL2NvbnRyaWIvZmlsZXV0bC5jYwkyMDI2LTA1
LTAzIDE3OjIwOjQwLjEzMDI1MDMwNyArMDUzMAorKysgYXB0LTMuMy4wL2FwdC1wa2cvY29udHJp
Yi9maWxldXRsLmNjCTIwMjYtMDUtMDMgMTc6MjI6MTEuODk4MDkzNzk1ICswNTMwCkBAIC0zMjAs
NiArMzIwLDcgQEAKIAkgICAgX2Vycm9yLT5FcnJubygib3BlbiIsIF8oIkNvdWxkIG5vdCBnZXQg
bG9jayAlcyIpLCBGaWxlLmNfc3RyKCkpOwogCiAJIF9lcnJvci0+Tm90aWNlKF8oIkJlIGF3YXJl
IHRoYXQgcmVtb3ZpbmcgdGhlIGxvY2sgZmlsZSBpcyBub3QgYSBzb2x1dGlvbiBhbmQgbWF5IGJy
ZWFrIHlvdXIgc3lzdGVtLiIpKTsKKwkgX2Vycm9yLT5Ob3RpY2UoXygiSWYgbm8gcGFja2FnZSBt
YW5hZ2VyIGlzIHJ1bm5pbmcsIHJlbW92ZSB0aGUgc3RhbGUgbG9jayB3aXRoOiBzdWRvIHJtIC1m
ICVzIiksIEZpbGUuY19zdHIoKSk7CiAgICAgICB9CiAKICAgICAgIHJldHVybiAtMTsK
--0000000000000b7f2b0650e87cf5--

------------=_1777812422-1063555-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at 1135601-done) by bugs.debian.org; 3 May 2026 12:45:06 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
	(2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-12.2 required=4.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HAS_BUG_NUMBER,PGPSIGNATURE,
	SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no
	version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 21; hammy, 136; neutral, 55; spammy,
	1. spammytokens:0.863-+--believing
	hammytokens:0.000-+--H*ct:application, 0.000-+--H*ct:protocol,
	0.000-+--H*ct:micalg, 0.000-+--H*ct:signed, 0.000-+--H*ct:pgp-signature
Return-path: <[email protected]>
Received: from mailgate01.uberspace.is ([95.143.172.20]:37148)
	by buxtehude.debian.org with esmtps (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
	(Exim 4.96)
	(envelope-from <[email protected]>)
	id 1wJWBz-004SZd-2T
	for [email protected];
	Sun, 03 May 2026 12:45:06 +0000
Received: from hermippe.uberspace.de (hermippe.uberspace.de [185.26.156.84])
	by mailgate01.uberspace.is (Postfix) with ESMTPS id 2537A60D3C
	for <[email protected]>; Sun, 03 May 2026 14:37:06 +0200 (CEST)
Received: (qmail 2588 invoked by uid 988); 3 May 2026 12:37:06 -0000
Authentication-Results: hermippe.uberspace.de;
	auth=pass (plain);
	dkim=none (length tag is unsupported) header.i=unknown header.d=kalnischkies.de header.s=mail
Received: from unknown (HELO unknown) (::1)
	by hermippe.uberspace.de (Haraka/3.1.1) with ESMTPSA; Sun, 03 May 2026 14:37:05 +0200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalnischkies.de;
 [email protected]; l=2819; q=dns/txt; s=mail; t=1777811824; h=date :
 from : to : cc : message-id : references : mime-version : content-type
 : in-reply-to : from; bh=ktjUQsRBOVbvmgXD00EX7iqAz010xnnSd1zIUVhzMu4=;
 b=tZ/z/KH+xfHctMGBYRXcO1V8clMUlkNP6y2c3Dejr/HQIEXPJGUuaosASbsRHC9WJh27Y
 z9SipvJvhxuwvcbt30wtM7LD25WfTcEH27B4iWi3LLrEHyNdUk8LjhA61rZma4YNu/wHuq2
 Nbgh5Em7GKDKPYbspLD1SKqEhn0lykzy0VH6WJbBZThlGo/ch2s0CAXwig0fSDQ0QgsQdMQ
 bdME9OkjMTNcRCjcubv1Oq8tr3pDffGrBDzDxrkE3QA4ZgMiqE6RZ6OBk2cCRDCMhmszuKS
 B18LMWVYt/uEnDkCt1QnkjViKW2ENO/Pyk7uleYZaTt4IRlURFQ2TYJarMIA==
Date: Sun, 3 May 2026 14:37:03 +0200
From: David Kalnischkies <[email protected]>
To: Ashwin Gundarapu <[email protected]>
Cc: [email protected]
Subject: Re: Bug#1135601: apt: Add stale lock removal hint for users
Message-ID: <[email protected]>
References: <CANAeh8dGDPif3_HSPj0-vGjcT9Uutq5atzU9cQ9ByuqjZsrcqQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="le4qa5i4pdaifn2w"
Content-Disposition: inline
In-Reply-To: <CANAeh8dGDPif3_HSPj0-vGjcT9Uutq5atzU9cQ9ByuqjZsrcqQ@mail.gmail.com>
X-Rspamd-Bar: --
X-Rspamd-Report: BAYES_HAM(-0.084504) SIGNED_PGP(-2) MIME_GOOD(-0.2)
X-Rspamd-Score: -2.284504
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
	d=kalnischkies.de; s=uberspace;
	h=from:to:cc:subject:date;
	bh=ktjUQsRBOVbvmgXD00EX7iqAz010xnnSd1zIUVhzMu4=;
	b=Ii026eFayJ0gJFetZKP3Y/0MIvfG5JNoRYqE2X/lQWVphobzs74abfW4c1TnRYNLsz8NZ0kZEE
	U2zp97EDYSQPLfg0XHzKd7QYGBztyzmuIpDZLKUz73Fm8IB9X4blcXm7JGupNyZ1ThtZAlUxEMg0
	oNuIxq/7lQEmGE0plzhGMu1fZFTWVRCpZEryFbIMj4OlsKZG9zsRvVj7VNFetvYnDtCMHkwtUzPP
	yk2UkY65DA7jKTAXNMlXfpx/Z9jqm5denDcOmraAjmCF/zwyLpQvPWVRU7+CxDkukbgwlJ00LMtI
	F1fAgNNkIXE8HHHtWP3mZd6sKUM6hHv14rluPVPYyaGnyCZviyAI1nR1xEDZUZsUH6LzC4d4dNjl
	PrTeTNcJ4ncJ5q1AHTkleV/rlCVjhDtTvEgq+anq17aHO4ay/g4j5AcLQGxLtgyeP74ooK52Bg28
	CN1HWWPB6nkW5gjkaIeB8pLRFgMAL3w7dr2S1xohDIj7fgPufNUrD7tfObUUF1etm1SuqdW7teA4
	YVNtU5mYwRCTJu3brO8RALK5opSfzKOivoZa5yurpdytsvKusF8VYhkqDaFMVUnucirqHux5Jx9U
	hnDwGKngcgpDDq2YUSL78ZwwArTmmmEMd0lN/Y6j8ETI6Hs/ymuQ3cY/zxiLsPbEDo0Bes0izPUa
	U=
X-Greylist: delayed 462 seconds by postgrey-1.37 at buxtehude; Sun, 03 May 2026 12:45:03 UTC


--le4qa5i4pdaifn2w
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Subject: Re: Bug#1135601: apt: Add stale lock removal hint for users
MIME-Version: 1.0

Am Sun, May 03, 2026 at 05:24:27PM +0530, schrieb Ashwin Gundarapu:
> When apt encounters a stale lock file with no owning process,

This can not happen by definition of how flock operates.

The existence of the file is of no concern. It is always there
(after the first run). File existence is not the lock.

A process having an open file descriptor for this file and getting
a lock on that is. A process releases a file descriptor automatically
if it ends, regardless if sucessfully or otherwise.

It can not be "stale". So if the lock is still active, a process
owning that lock is still in existence. That process might "hang",
if so we will need to figure out which one and why, but removing the
lock file is NEVER the solution to that problem. The removal of the
file is not releasing the lock. The file descriptor remains open even
if the filename it was opened with disappears. So you now have two
processes both believing to be the sole owner of a lock. At least one
of them probably doing things in the background like an unattended
upgrade activation.

The code just handles the case of the kernel not knowing or telling
us (in a way libapt could understand programmatically) which process
owns the lock. You will have to read kernel documentation as to why
it might do so. libapt is just defensive here.


As this is fundamentely bad, incorrect & potentially dangerous advise,
based on a misunderstanding of how flock'ing works =E2=80=93 that is sadly =
way
too common =E2=80=93 I am closing this wishlist item as "hell no".


Best regards

David Kalnischkies

--le4qa5i4pdaifn2w
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE5sn+Q4uCja/tn0GrMRvlz3HQeIMFAmn3QW8ACgkQMRvlz3HQ
eINwTA//Zk8mkLIQYvVmHbjiZbmCtiFdkdpkocJq6LJ4eLUE/mi+tiWrdRLQeRYe
4FJ2/wYB4v2D/0eQN1oe+F0EYQ5pM7yCG6V4iujG2zwJF0aNuFw5vQEmx6Wj3qQQ
CPeSnYFnQdwwpS8/7ew3ZwoUs7uSR5C6zQppWfSq4ZODKu06Zxd72uYoTBbTBmNS
KxU3zT92l7AqPsK58fmGUjGfrd1QDYkVlpW5GjYvEyjD17rkvA0ONPN2ufE9mKvX
XXTOY3Lxe7toXCAntfdREfwe3+OXAaP/hb5c2Ht3y45v/5XmUtD2WufHgP1W4RNx
3/zJwBQqY4adVqORldnAGtmza9yMDPTTvwadGhAvzt5ysUjjC/z1Yz2PrVaYjrT9
hxg6FQ4S1XPcF9IABjymXxnq0cJG/vlsmNuQfbJHCnNUW41iS2GtQdf47OMyNTa1
i8td8aX1wbw0d7rh/tyNS0oDJW7AuEf6gbn47/xPZMM+X4iuVGf5sIiaKuzUFnhs
ioQea0+LBAl2WoBmF//MkZpWr9AUJ3SB9o0CvYX3vIje1mE5WX3NzkUqiExd4FlV
CGsjUMxzHNfjiserhv/6evyB2Hi9fcCCzdoiUEHAsvgvfZHdYuzkemppD81XKYNO
IrL77Kj4Zqmz5tnhk4mYMV1krqNMk0p3XBm6DoMSx9hpTgtnttk=
=HdSq
-----END PGP SIGNATURE-----

--le4qa5i4pdaifn2w--
------------=_1777812422-1063555-0--