Thread View: linux.debian.user
6 messages
6 total messages
Started by Detlef Vollmann
Thu, 22 Oct 2026 09:30
How to remove a package for which prerm fails
Author: Detlef Vollmann
Date: Thu, 22 Oct 2026 09:30
Date: Thu, 22 Oct 2026 09:30
20 lines
2368 bytes
2368 bytes
Hello, on an old system in a VM I did a 'apt autoremove' and removal for a package failed. So I tried 'dpkg -r --force-all hddtemp' and it failed with: old hddtemp package prerm maintainer script subprocess failed with exit status 1 So I did a 'dpkg -P --force-all hddtemp' which according to the man page shouldn't run the 'prerm' script, but it still failed with the same message. Is there a package management tool that allows me to remove the package anyways? I could create some dummy script that makes sure the prerm script doesn't fail, but I'm curious if there's an "official" way to do it. Detlef
Re: How to remove a package for which prerm fails
Author: Nicolas George
Date: Thu, 22 Oct 2026 10:30
Date: Thu, 22 Oct 2026 10:30
26 lines
2896 bytes
2896 bytes
Hi. Detlef Vollmann (HE12026-10-22): > on an old system in a VM I did a 'apt autoremove' and removal > for a package failed. > So I tried 'dpkg -r --force-all hddtemp' and it failed with: > > old hddtemp package prerm maintainer script subprocess failed with exit > status 1 > > So I did a 'dpkg -P --force-all hddtemp' which according to the > man page shouldn't run the 'prerm' script, but it still failed > with the same message. > > Is there a package management tool that allows me to remove the > package anyways? > > I could create some dummy script that makes sure the prerm script > doesn't fail, but I'm curious if there's an "official" way to do it. Start by looking at the prerm script and find out WHY it fails. Regards, -- Nicolas George
Re: How to remove a package for which prerm fails
Author: Greg Wooledge
Date: Thu, 22 Oct 2026 11:50
Date: Thu, 22 Oct 2026 11:50
28 lines
2916 bytes
2916 bytes
On Thu, Oct 22, 2026 at 12:28:45 +0200, Nicolas George wrote: > > Detlef Vollmann (HE12026-10-22): > > old hddtemp package prerm maintainer script subprocess failed with exit > > status 1 > > I could create some dummy script that makes sure the prerm script > > doesn't fail, but I'm curious if there's an "official" way to do it. > > Start by looking at the prerm script and find out WHY it fails. The scripts are in /var/lib/dpkg/info/ and this one should be named hddtemp.prerm (packagename dot prerm). They are almost always /bin/sh scripts. Assuming yours is a /bin/sh script, a reasonable starting point would be adding "set -x" below the header line, to enable trace mode. This will show you everything the script is doing. Then repeat your "dpkg --purge hddtemp" command and see what happens. If you decide that the failure is harmless (or that you can do manually what the script was trying to do automatically), you can put "exit 0" near the top of the script so that it succeeds without doing anything, which will enable the package removal to proceed to the next step. However, please be sure you *understand* what's failing before doing that. If you don't understand the set -x output, post it here and ask for guidance.
Re: How to remove a package for which prerm fails
Author: tomas
Date: Thu, 22 Oct 2026 12:00
Date: Thu, 22 Oct 2026 12:00
50 lines
2953 bytes
2953 bytes
--ML5g2x+ZYMozgHac Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 22, 2026 at 12:28:45PM +0200, Nicolas George wrote: > Hi. >=20 > Detlef Vollmann (HE12026-10-22): [...] > > I could create some dummy script that makes sure the prerm script > > doesn't fail, but I'm curious if there's an "official" way to do it. >=20 > Start by looking at the prerm script and find out WHY it fails. This. As a last ditch, your prerm script is in /var/lib/dpkg/info/<your-package>.prerm So you can "just remove it" or insert some "exit 0" at an appropriate place. *BUT* as Nicolas says, perhaps the script is trying to do something useful and can't, for some reason. So understanding that might improve your installation's integrity and longevity ;-) Plus, you might discover a bug in the package, who knows. Cheers --=20 t --ML5g2x+ZYMozgHac Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCatn5EAAKCRAFyCz1etHa RrzKAJoCSM6KRu+T5UTyeXLnCXN8krfbiQCfRZuHQ48nr3O1j73N3b2O1VWb4MY= =T9lO -----END PGP SIGNATURE----- --ML5g2x+ZYMozgHac--
Re: How to remove a package for which prerm fails
Author: Detlef Vollmann
Date: Thu, 22 Oct 2026 13:10
Date: Thu, 22 Oct 2026 13:10
33 lines
3095 bytes
3095 bytes
On 10/22/26 12:28, Nicolas George wrote: > Hi. > > Detlef Vollmann (HE12026-10-22): >> on an old system in a VM I did a 'apt autoremove' and removal >> for a package failed. >> So I tried 'dpkg -r --force-all hddtemp' and it failed with: >> >> old hddtemp package prerm maintainer script subprocess failed with exit >> status 1 >> >> So I did a 'dpkg -P --force-all hddtemp' which according to the >> man page shouldn't run the 'prerm' script, but it still failed >> with the same message. >> >> Is there a package management tool that allows me to remove the >> package anyways? >> >> I could create some dummy script that makes sure the prerm script >> doesn't fail, but I'm curious if there's an "official" way to do it. > > Start by looking at the prerm script and find out WHY it fails. Well, I know exactly why it fails and how to fix it. The prerm script calls 'invoke-rc.d' and these days it only uses systemd, but for this (very old) package there only exists an init.d script. So the fix is to provide a no-op hddparm.service. But my question was about a debian package management tool that I can tell to ignore the return value of the prerm script. Detlef
Re: How to remove a package for which prerm fails
Author: tomas
Date: Thu, 22 Oct 2026 13:20
Date: Thu, 22 Oct 2026 13:20
43 lines
3219 bytes
3219 bytes
--s6JqdeLDp01jybHE
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Thu, Oct 22, 2026 at 02:59:41PM +0200, Detlef Vollmann wrote:
[...]
> Well, I know exactly why it fails and how to fix it.
> The prerm script calls 'invoke-rc.d' and these days it only
> uses systemd, but for this (very old) package there only exists
> an init.d script.
> So the fix is to provide a no-op hddparm.service.
>=20
> But my question was about a debian package management tool
> that I can tell to ignore the return value of the prerm script.
I think this doesn't exist. Paradoxically, I think that makes sense:
a failure in a {pre,post}-{install,remove} script indicates an
exceptional situation the packagers haven't taken in account, thus
one they could't provide for; thus the intervention of a sysadmin
with knowledge seems appropriate.
A force argument for that seems like a dangerous trap. Better having
folks come here, as you did (I myself did, a while back :-)
Cheers
--=20
t
--s6JqdeLDp01jybHE
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCatoL4AAKCRAFyCz1etHa
RilwAJ9l4QfJUrZnzOSd6AFW44NlNvtXXACfX1Q2YCSqAQw/L8mtKEMn1i9450M=
=ZmpA
-----END PGP SIGNATURE-----
--s6JqdeLDp01jybHE--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads