无法在 18.04.2 上完全安装 hwe 堆栈

无法在 18.04.2 上完全安装 hwe 堆栈

我刚刚尝试使用 安装 HWE 堆栈sudo apt-get install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04,但安装不完整。没有生成启动映像,没有/lib/modules为其加载任何内容,等等。我做错了什么?

安装命令的输出:

The following NEW packages will be installed:
  linux-generic-hwe-18.04 xserver-xorg-hwe-18.04
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/15.2 kB of archives.
After this operation, 248 kB of additional disk space will be used.
Selecting previously unselected package linux-generic-hwe-18.04.
(Reading database ... 407048 files and directories currently installed.)
Preparing to unpack .../linux-generic-hwe-18.04_4.18.0.15.65_amd64.deb ...
Unpacking linux-generic-hwe-18.04 (4.18.0.15.65) ...
Selecting previously unselected package xserver-xorg-hwe-18.04.
Preparing to unpack .../xserver-xorg-hwe-18.04_1%3a7.7+19ubuntu8~18.04.2_amd64.deb ...
Unpacking xserver-xorg-hwe-18.04 (1:7.7+19ubuntu8~18.04.2) ...
Setting up xserver-xorg-hwe-18.04 (1:7.7+19ubuntu8~18.04.2) ...
Setting up linux-generic-hwe-18.04 (4.18.0.15.65) ...

输出uname -a

Linux my-computer-name 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

尝试手动安装两个明显缺失的依赖项的输出:

sudo apt install linux-image-generic-hwe-18.04 linux-headers-generic-hwe-18.04
[sudo] password for brandon: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-generic-hwe-18.04 is already the newest version (4.18.0.15.65).
linux-headers-generic-hwe-18.04 set to manually installed.
linux-image-generic-hwe-18.04 is already the newest version (4.18.0.15.65).
linux-image-generic-hwe-18.04 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

输出dpkg -l | grep linux-image

rc  linux-image-4.15.0-20-generic                   4.15.0-20.21                                 amd64        Signed kernel image generic
ii  linux-image-4.15.0-45-generic                   4.15.0-45.48                                 amd64        Signed kernel image generic
ii  linux-image-4.18.0-15-generic                   4.18.0-15.16~18.04.1                         amd64        Signed kernel image generic
ii  linux-image-generic                             4.15.0.45.47                                 amd64        Generic Linux kernel image
ii  linux-image-generic-hwe-18.04                   4.18.0.15.65                                 amd64        Generic Linux kernel image

输出sudo update-grub

Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-45-generic
Found initrd image: /boot/initrd.img-4.15.0-45-generic
Found Windows Boot Manager on /dev/sdb1@/efi/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done

[这台笔记本电脑预装了 Windows 并运行它,因此有 WBM 条目。]

尝试手动重新安装映像时出错:

depmod: ERROR: could not open directory /lib/modules/4.18.0-15-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
dpkg: error processing package linux-image-4.18.0-15-generic (--configure):
 installed linux-image-4.18.0-15-generic package post-installation script subprocess returned error exit status 1

答案1

您可以使用低级命令重新安装此内核和模块(下载并直接提取到文件系统):

apt-get download linux-image-4.18.0-15-generic
apt-get download linux-modules-extra-4.18.0-15-generic
apt-get download linux-modules-4.18.0-15-generic
apt-get download linux-headers-4.18.0-15-generic

sudo dpkg -x linux-image-4.18.0-15-generic*.deb /
sudo dpkg -x linux-modules-extra-4.18.0-15-generic*.deb /
sudo dpkg -x linux-modules-4.18.0-15-generic*.deb /
sudo dpkg -x linux-headers-4.18.0-15-generic*.deb /

sudo update-grub

然后以常规方式重新安装它们:

sudo apt-get install --reinstall linux-image-4.18.0-15-generic
sudo apt-get install --reinstall linux-modules-extra-4.18.0-15-generic
sudo apt-get install --reinstall linux-modules-4.18.0-15-generic
sudo apt-get install --reinstall linux-headers-4.18.0-15-generic

最后安装 HWE:

sudo apt-get install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04

答案2

使用 FAI 部署 Bionics 时也会出现同样的问题。安装 HWE 内核时不会生成 initrd。作为安装 HWE 软件包后的解决方法,我还手动创建了 initrd

update-initramfs -c -k `ls -1 /lib/modules/ | head -2 | tail -1`
update-grub

它假设从 /lib/modules 获取最新的内核版本。

相关内容