Dear Maintainer, I was experiencing long delays on shutdown of my laptop because anacron was running a long running task with no time limit. I found anacron was only installed because it was a dependency of task-laptop. I removed task-laptop then I tried to remove anacron using "apt remove --purge anacron" . However this lead to a hang and the removal process never terminates, requiring killall.
Other than task-laptop, logrotate also depends on anacron, so I would not recommend removal. If you know which task is long running, you could disable the task in "/etc/cron.*", "/etc/anacrontab", or "/etc/crontab". I am not familiar with "apt remove --purge", so I have added the apt team mailing list to help with debugging this issue. Any logs or other information you could provide would also be be good to have.
I am appending this comment to bug 1074540 because I suspect they're related. A recent `apt-get --auto-remove dist-upgrade` in Debian Testing hung for me at this line in the output: Installing new version of config file /etc/cron.d/anacron ... `pstree` showed this: dpkg(2935259)─┬─anacron.postins(2935268)───deb-systemd-inv(2935625)───systemctl(2935633)───systemd-tty-ask(2935634) └─sh(2935263)───sh(2935264)───dpkg-status(2935265) The `systemd-tty-ask` process command line was `/usr/bin/systemd-tty-ask-password-agent --watch`. The `systemctl` command line was `systemctl --quiet --system restart anacron.service anacron.timer`. I tried killing the `systemd-tty-ask-password-agent` process, but it refused to die, even with `kill -9`. I had to kill the `systemctl --quiet --system restart anacron.service anacron.timer` process to get the upgrade to continue.