6

After trying to shutdown a Ubuntu 18.04 virtual machine, i get this message:

a stop job is running for unattended upgrades shutdown

enter image description here

What to do now?

2 Answers2

9

Be patient. Wait for Unattended Upgrades to finish.

DO NOT interrupt Unattended Upgrades while it is upgrading your system. Doing so might break your system quite horribly, including possibly making your system unbootable.

Generally, U-U will only run for a minute or two. If it's taking longer, then ensure your system has good, strong network connectivity. That speeds U-U up a lot.

user535733
  • 62,253
  • 1
    That makes sense but... what about when network connectivity is lost? Changed some stuff on my computer and now my VM won't shut down, since its upgrades will never finish without network connectivity. – A Tyshka Jul 02 '20 at 01:51
  • @ATyshka that seems a rare and entirely self-inflicted corner case. It makes no sense at all to run network-dependent services like Unattended Upgrades on an offline system. See https://askubuntu.com/questions/934807/unattended-upgrades-status for how to detemine when it's safe to kill apt. Use at your own risk. – user535733 Jul 02 '20 at 03:54
  • It's not an offline system. The Vm was suspended, I upgraded my vmware and it required rebooting suspended Vms to re-enable network connectivity. Regardless, it auto-killed after 30 mins, and now I'm trying to save the installation – A Tyshka Jul 02 '20 at 03:59
  • I experienced a difficult time after hard rebooting a production server and finding your answer. Luckily the server(ubuntu 20.04) recovered from interrupting Unattended Upgrades. But I will never do that, people could wait for a while instead of waiting for a day or two! – SidMorad Nov 27 '23 at 08:22
2

I think the real answer is here: https://ostechnix.com/how-to-disable-unattended-upgrades-on-ubuntu/

Disable Unattended Upgrades with $ sudo dpkg-reconfigure unattended-upgrades or remove them completely with $ sudo apt remove unattended-upgrades. This is pretty much necessary to preserve sanity if you only use Ubuntu occasionally in a VM or similar.