x-r*_*ray 2 upgrade command-line apt systemd 22.04
apt dist-upgrade在 Ubuntu Server 22.04.3 中以 root shell运行后,有时Which services should be restarted?会出现此问题。例子:
Restarting services...
Daemons using outdated libraries
--------------------------------
1. 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?
Run Code Online (Sandbox Code Playgroud)
我在这个提示中得到的唯一答案是输入一个数字,这只会重新启动该服务,然后退出。例子:
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:~#
Run Code Online (Sandbox Code Playgroud)
如何回答此提示以重新启动所有(或选择的多个)服务?
小智 5
你知道选项 13 是 吗none of the above?意思是,如果您想重新启动任何其他项目,则不应包含它?
因此,只需省略选项 13 即可进行响应:
Which services should be restarted? 1 2 3 4 5 6 7 8 9 10 11 12
Run Code Online (Sandbox Code Playgroud)
或者因为范围也被接受:
Which services should be restarted? 1-12
Run Code Online (Sandbox Code Playgroud)