ubuntu升级软件包,提示运行的内核版本6.8.0-36-generic不是最新的6.8.0-41-generic,提示更新后需要重启,针对该问题:
输入命令 sudo reboot 进行重启,正常更新。
未重启的一些错误提示:
Pending kernel upgrade! Running kernel version: 6.8.0-36-generic Diagnostics: The currently running kernel version is not the expected kernel version 6.8.0-41-generic. Restarting the system to load the new kernel will not be handled automatically, so you should consider rebooting. Restarting services... Service restarts being deferred: /etc/needrestart/restart.d/dbus.service systemctl restart systemd-logind.service systemctl restart unattended-upgrades.service No containers need to be restarted. User sessions running outdated binaries: root @ session #1: login[910] root @ session #3: sshd[1107,1156] root @ user manager service: systemd[1037] No VM guests are running outdated hypervisor (qemu) binaries on this host.
重启后的正常提示:
:~$ sudo apt upgrade Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: linux-headers-6.8.0-31 linux-headers-6.8.0-31-generic linux-image-6.8.0-31-generic linux-modules-6.8.0-31-generic linux-modules-extra-6.8.0-31-generic linux-tools-6.8.0-31 linux-tools-6.8.0-31-generic Use 'sudo apt autoremove' to remove them. The following upgrades have been deferred due to phasing: python-apt-common python3-apt 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Ubuntu 22.04 默认自带了 needrestart ,apt集成在一起,后台服务依赖库升级,就会触发这个提示。直接按 ESC 跳过就好了,并不是强制重启的。
你要是想完全关闭,直接卸载掉。
安装命令: sudo apt install needrestart 显示重启的服务命令: sudo needrestart -b 卸载命令: sudo apt purge needrestart -y 重启机器: sudo reboot
参考文章:
https://askubuntu.com/questions/1404129/ubuntu-22-04-lts-on-wsl-failed-to-retrieve-available-kernel-versions-failed
https://m.blog.naver.com/dev-blackcat/222874029106
原创文章,作者:开心电脑网,如若转载,请注明出处。