After running apt dist-upgrade in a root shell in Ubuntu Server 22.04.3, sometimes the question Which services should be restarted? is shown. Example:
Restarting services...
Daemons using outdated libraries
--------------------------------
- dbus.service 2. getty@tty1.service 3. multipathd.service 4. networkd-dispatcher.service 5. packagekit.service 6. polkit.service 7. ssh.service 8. systemd-logind.service 9. systemd-manager 10. thermald.service 11. unattended-upgrades.service 12. user@1000.service 13. none of the above
(Enter the items or ranges you want to select, separated by spaces.)
Which services should be restarted? 1-13
Which services should be restarted? 1 - 13
Which services should be restarted? 1..13
Which services should be restarted? 1 .. 13
Which services should be restarted? 1...13
Which services should be restarted? 1 ... 13
Which services should be restarted? 1 to 13
Which services should be restarted? 1 2 3 4 5 6 7 8 9 10 11 12 13
Which services should be restarted? 1,2,3,4,5,6,7,8,9,10,11,12,13
Which services should be restarted?
The only answer I got working in this prompt was to input a single number, which would only restart that one service and then exit. Example:
Which services should be restarted? 1
/etc/needrestart/restart.d/dbus.service
Service restarts being deferred:
systemctl restart getty@tty1.service
systemctl restart multipathd.service
systemctl restart networkd-dispatcher.service
systemctl restart packagekit.service
systemctl restart polkit.service
systemctl restart ssh.service
systemctl restart systemd-logind.service
/etc/needrestart/restart.d/systemd-manager
systemctl restart thermald.service
systemctl restart unattended-upgrades.service
systemctl restart user@1000.service
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@ubuntu-server:~#
How do I answer this prompt to restart all (or a selection of multiple) services?