Package: cron
Version: 3.0pl1-154
Severity: normal
Dear Maintainer,
The postrm script in the current version of the cron package assumes the
presence of a dpkg-statoverride for /usr/bin/crontab, but no such statoverride
is present on my systems. As a result when I try to 'purge' the cron package
the process fails.
Recipe to reproduce the issue:
1) cd /root
2) mkdir foo
3) debootstrap --variant=minbase --include=logrotate,systemd-cron bookworm
4) chroot /root/foo /bin/bash
5) apt remove --purge cron
This results in the following output:
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
cron*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
(Reading database ... 11054 files and directories currently installed.)
Purging configuration files for cron (3.0pl1-154) ...
dpkg-statoverride: warning: no override present
dpkg: error processing package cron (--purge):
installed cron package post-removal script subprocess returned error exit
status 2
Errors were encountered while processing:
cron
E: Sub-process /usr/bin/dpkg returned an error code (1)
Editing /var/lib/dpkg/info/cron.postrm to remove the first section resolves the
issue.
-- System Information:
Debian Release: bookworm/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 6.0.0-6-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE,
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages cron depends on:
ii cron-daemon-common 3.0pl1-154
ii init-system-helpers 1.65.2
ii libc6 2.36-7
ii libpam-runtime 1.5.2-5
ii libpam0g 1.5.2-5
ii libselinux1 3.4-1+b4
ii sensible-utils 0.0.17
Versions of packages cron recommends:
ii msmtp-mta [mail-transport-agent] 1.8.22-1
Versions of packages cron suggests:
pn checksecurity <none>
ii logrotate 3.21.0-1
ii systemd-cron [anacron] 1.15.19-2+b1