Hacker News new | ask | show | jobs
by esbeeb 923 days ago
In Debian bookworm:

"sudo systemctl stop unattended-upgrades.service" ...wasn't able to prevent unattended-upgrades from going on ahead and just upgrading (to this problematic kernel) anyway.

Unintuitively, the "right" way to disable unattended-upgrades is:

"sudo dpkg-reconfigure unattended-upgrades" ...and choose "No" when asked.

4 comments

Most likley because you stopped the wrong service. You should have stopped the relevant timer service, not the service that the timer starts.
> You should have stopped the relevant timer unit, not the service unit that the timer starts.

FTFY. Helps keeping them apart to not use the same word for both ;)

    systemctl disable --now unattended-upgrades.timer;
    systemctl disable --now unattended-upgrades.service
No need to uninstall or mask.
Can you give example code to stop that timer?
It's the same, but you disable the timer instead of the service. `sudo systemctl stop unattended-upgrades.timer`
It will still start when you next boot up. 'systemctl disable --now unattended-upgrades.timer' will stop it now _and_ remove the symlink that starts it at boot.
Probably better to mask it instead if you don't want it to execute at all
Usually, it's the same service name but with .timer at the end instead of .service.
dpkg-reconfigure is really important and maybe a bit outdated, but definitely something users should know? I think it's also responsible for turning 'apt upgrade' into a little text adventure, e.g. by showing lots of prompts like "Do you want to replace/skip your sshd config"?
It's better to use configuration / override directories such as sshd_config.d/ to specify customizations.
Tbf, you also would have to explicitly enable automatic reboots (or manually reboot after the new kernel).

That said, I certainly wouldn’t blame anyone for blindly trusting a kernel in Stable. This hurts.

systemctl stop is a oneshot operation, right? Perhaps sudo apt remove unattended-upgrades?