这是 VirtualBox 中的虚拟机。
我感觉下面的消息试图告诉我一些事情,但无法告诉我到底发生了什么
这是从 16.04 升级到 18.04 后出现的,因此它被延续到了 20.04
Welcome to Ubuntu 20.04 LTS (GNU/Linux 5.4.0-28-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Fri 01 May 2020 12:11:08 PM CEST
System load: 1.75 Processes: 312
Usage of /: 28.6% of 117.25GB Users logged in: 0
Memory usage: 25% IPv4 address for docker0: 172.17.0.1
Swap usage: 0% IPv4 address for eth0: xxxxxxxxxxxxxx
=> There is 1 zombie process.
0 updates can be installed immediately.
0 of these updates are security updates.
You have packages from the Hardware Enablement Stack (HWE) installed that
are going out of support on 2025-04-30.
To upgrade to a supported (or longer-supported) configuration:
* Upgrade from Ubuntu 18.04 LTS to Ubuntu 20.04 LTS by running:
sudo do-release-upgrade -p
OR
* Switch to the current security-supported stack by running:
sudo apt-get install
and reboot your system.
该行不应该sudo apt-get install
包含包名称吗?
做apt-get update && apt-get upgrade
沒有幫助。
这样做apt-get install
也无济于事:
$ sudo apt-get install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libaec-dev libaec0 libeccodes-data libgfortran4 libgl1-mesa-glx libsz2 linux-image-4.4.0-178-generic linux-modules-4.4.0-178-generic
linux-modules-extra-4.4.0-178-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
libaec-dev libaec0 libeccodes-data libgfortran4 libgl1-mesa-glx libsz2 linux-image-4.4.0-178-generic linux-modules-4.4.0-178-generic
linux-modules-extra-4.4.0-178-generic
0 upgraded, 0 newly installed, 9 to remove and 0 not upgraded.
After this operation, 271 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 142621 files and directories currently installed.)
Removing libaec-dev:amd64 (1.0.4-1) ...
Removing libsz2:amd64 (1.0.4-1) ...
Removing libaec0:amd64 (1.0.4-1) ...
Removing libeccodes-data (2.16.0-1) ...
Removing libgfortran4:amd64 (7.5.0-6ubuntu2) ...
Removing libgl1-mesa-glx:amd64 (20.0.4-2ubuntu1) ...
Removing linux-modules-extra-4.4.0-178-generic (4.4.0-178.208) ...
Removing linux-image-4.4.0-178-generic (4.4.0-178.208) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.4.0-178-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-28-generic
Found initrd image: /boot/initrd.img-5.4.0-28-generic
Found linux image: /boot/vmlinuz-4.15.0-99-generic
Found initrd image: /boot/initrd.img-4.15.0-99-generic
Found linux image: /boot/vmlinuz-4.2.0-34-generic
Found initrd image: /boot/initrd.img-4.2.0-34-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
Removing linux-modules-4.4.0-178-generic (4.4.0-178.208) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
打印出从 18.04 升级到 20.04 的结束信息
Processing triggers for mime-support (3.64ubuntu1) ...
dpkg: warning: package not in status nor available database at line 2: gcc-5:amd64
dpkg: warning: package not in status nor available database at line 3: libharfbuzz-dev:amd64
dpkg: warning: package not in status nor available database at line 4: libharfbuzz-icu0:amd64
dpkg: warning: package not in status nor available database at line 5: libisl19:amd64
dpkg: warning: found unknown packages; this might mean the available database is outdated, and needs to be updated through a frontend method; please see the FAQ <https://wiki.debian.org/Teams/Dpkg/FAQ>
System upgrade is complete.
我怎样才能找到这个有问题的消息的根源?
答案1
我设法找到了该消息的根本原因,原来仍安装着过时的 Linux 内核。
我所做的是首先找到这条消息的来源,/etc/update-motd.d/95-hwe-eol
并将其打印出来。
这个文件实际上只是执行了该文件/usr/lib/update-notifier/update-motd-hwe-eol
。
除其他内容外,该文件还执行了/usr/bin/hwe-support-status
一个 Python 脚本,它在进行一些检查后实际上会生成消息。
此文件检查的内容之一是内核映像的正则表达式:
UNSUPPORTED_KERNEL_IMAGE_REGEX = \
r'linux-image.*-(3\.16|3\.19|4\.2)(\.[0-9]+)?-.*'
我的/boot/
目录包含以下文件:
drwxr-xr-x 3 root root 4.0K May 1 12:12 .
drwxr-xr-x 22 root root 4.0K May 1 11:59 ..
drwxr-xr-x 5 root root 4.0K May 1 12:12 grub
-rw------- 1 root root 3.6M Mar 11 2016 System.map-4.2.0-34-generic
-rw------- 1 root root 3.9M Apr 22 20:31 System.map-4.15.0-99-generic
-rw------- 1 root root 4.6M Apr 22 16:08 System.map-5.4.0-28-generic
-rw-r--r-- 1 root root 1.3M Mar 11 2016 abi-4.2.0-34-generic
-rw-r--r-- 1 root root 181K Mar 11 2016 config-4.2.0-34-generic
-rw-r--r-- 1 root root 213K Apr 22 20:31 config-4.15.0-99-generic
-rw-r--r-- 1 root root 233K Apr 22 16:08 config-5.4.0-28-generic
-rw-r--r-- 1 root root 31M May 1 11:59 initrd.img-4.2.0-34-generic
-rw-r--r-- 1 root root 40M May 1 11:58 initrd.img-4.15.0-99-generic
-rw-r--r-- 1 root root 48M May 1 12:06 initrd.img-5.4.0-28-generic
-rw-r--r-- 1 root root 179K Feb 14 00:09 memtest86+.bin
-rw-r--r-- 1 root root 181K Feb 14 00:09 memtest86+.elf
-rw-r--r-- 1 root root 181K Feb 14 00:09 memtest86+_multiboot.bin
-rw------- 1 root root 6.5M Mar 11 2016 vmlinuz-4.2.0-34-generic
-rw------- 1 root root 8.0M Apr 22 20:32 vmlinuz-4.15.0-99-generic
-rw------- 1 root root 12M Apr 22 16:43 vmlinuz-5.4.0-28-generic
这暗示4.2.0
安装了不受支持的内核。
为了找到究竟是什么导致脚本打印出该消息,我复制了该脚本并对其进行了修改,以打印出有问题的包。
21:15 user@machine [dev] ~/debug-hwe$ ./hwe-support-status --show-all-unsupported --verbose --show-replacements
show_all_unsupported True
unsupported backport linux-image-4.2.0-34-generic
unsupported backport linux-image-extra-4.2.0-34-generic
因此删除sudo apt purge linux-image-4.2.0-34-generic
这两个包会导致消息消失。
基本上没什么危害,因为该内核不再使用,但无论如何清理它都是好事。我也删除了它,4.15.0
因为我也不需要它。
看起来该脚本在打印与内核相关问题相关的消息方面有点错误。
答案2
从 16.04 升级到 20.04 后遇到了同样的问题。
显示./hwe-support-status --show-all-unsupported --verbose
的内容什么也没有,只是ubuntu-security-status --unavailable
(自 2020 年 4 月的更新管理器 1:20.04.9 版本以来,在此之前ubuntu-support-status
)显示了来自上次主要更新的一些软件包,linux-headers-generic-lts-utopic
在我的情况下触发了 motd 警告。
看来我有一些清理工作要做;)