Liu*_*Bei 54 kernel microcode windows-subsystem-for-linux
我刚刚安装了适用于 Linux 的 Windows 子系统的 Ubuntu 22.04 LTS,但遇到了一些问题。每次我使用安装新软件包时sudo apt install,我都会收到两条消息:
Failed to retrieve available kernel versions.
Failed to check for processor microcode upgrades.
Run Code Online (Sandbox Code Playgroud)
使用 Ubuntu 20.04 LTS 时不会出现此问题。
即使我收到这些消息,我也可以安装 Linux 软件包并将它们成功集成到 Visual Studio Code 中。当我使用检查内核时uname -r,我得到了5.10.102.1-microsoft-standard-WSL2。
一切正常,但这些消息一直让我担心。
我想知道为什么会出现这些消息以及如何解决它们。谁能给我一些建议来解决这些问题?这些消息是致命的吗?
Not*_*1ds 81
简短回答:
sudo -e /etc/needrestart/needrestart.conf
Run Code Online (Sandbox Code Playgroud)
注意:-e使用默认的系统编辑器。如果您想使用不同的编辑器,只需运行sudo update-alternatives --config editor
取消注释并更改以下设置:
$nrconf{kernelhints} = 0;
$nrconf{ucodehints} = 0;
Run Code Online (Sandbox Code Playgroud)
安装软件包时您将不再收到这些警告。
更多细节:
这在背景上与 Raspberry Pi 上发生的相同“问题”类似,但根本原因略有不同。
确实没有什么可担心的。这是 Ubuntu 在安装软件包后进行的(最近)新检查,以确定是否需要采取其他操作。
处理此问题(并导致这些警告)的包是needrestart. 从apt show needstart:
Description: check which daemons need to be restarted after library upgrades
needrestart checks which daemons need to be restarted after library upgrades.
It is inspired by checkrestart from the debian-goodies package.
Features:
- supports (but does not require) systemd
- binary blacklisting (i.e. display managers)
- tries to detect required restarts of interpreter based daemons
(supports Java, Perl, Python, Ruby)
- tries to detect required restarts of containers (docker, LXC)
- tries to detect pending kernel upgrades
- tries to detect pending microcode upgrades for Intel CPUs
- could be used as nagios check_command
- fully integrated into apt/dpkg using hooks
Run Code Online (Sandbox Code Playgroud)
在 WSL2 下,内核和微代码都不会正确报告,因为我们在 WSL2 VM 内的容器中运行 Ubuntu(我们无法访问)。但是,鉴于上述信息,在某些情况下它可能会派上用场,具体取决于您运行的其他守护进程或容器。
您可以继续使用其余功能,无需通过上述配置文件更改进行内核/微代码检查。它们是否有用将取决于您的 WSL2 用例。
或者,如果您发现额外的输出没有派上用场,您可以通过以下方式完全删除该功能(根据 Raspberry Pi 问题中的指导):
sudo apt-get purge needrestart
Run Code Online (Sandbox Code Playgroud)
就我个人而言,我还不确定这个包作为 WSL2 默认 22.04 rootfs 的一部分是否真的有意义。但时间会证明一切。不过,我确信很多人在开始在 WSL 中安装 22.04 时都会有这个问题。
但是,如果您使用的是 WSL1,我在调查的现阶段的建议是完全删除该软件包。用于检查过时包的过程needrestart似乎无法在 WSL1 的系统调用翻译“伪内核”下工作,并且您将收到有关needrestart运行过时的二进制文件和库的定期误报,包括sh、apt和init(等等)。
| 归档时间: |
|
| 查看次数: |
47070 次 |
| 最近记录: |