卸载 4.5.3 Xubuntu 内核时遇到问题

卸载 4.5.3 Xubuntu 内核时遇到问题

我尝试删除这个手动安装的、不受支持的 4.5.3 Xubuntu 内核。现在,我的朋友帮我安装了它,所以我不确定他是怎么做到的。我查找了类似的答案,并按照步骤操作。

之后,当我尝试安装一些模块时,它们没有生效,我怀疑我在这里收到的消息表明了原因......?

我可能忘了做某事了,对吧?

Chris@Chris-crackle:/boot$ rm vmlinuz-4.5.3-040503-generic 
rm: remove write-protected regular file 'vmlinuz-4.5.3-040503-generic'? y
rm: cannot remove 'vmlinuz-4.5.3-040503-generic': Permission denied
chris@Chris-crackle:/boot$ sudo rm vmlinuz-4.5.3-040503-generic 
[sudo] password for chris: 
chris@Chris-crackle:/boot$ sudo rm initrd.img-4.5.3-040503-generic 
chris@Chris-crackle:/boot$ sudo rm System.map-4.5.3-040503-generic 
chris@Chris-crackle:/boot$ sudo rm config-4.5.3-040503-generic 
chris@Chris-crackle:/boot$ cd /lib
chris@Chris-crackle:/lib$ ls
apparmor   init                                  recovery-mode
brltty     klibc-k3La8MUnuzHQ0_kG8hokcGAC0PA.so  systemd
cgmanager  ld-linux.so.2                         sysvinit
cpp        linux-sound-base                      terminfo
crda       lsb                                   udev
firmware   modprobe.d                            ufw
hdparm     modules                               x86_64-linux-gnu
ifupdown   plymouth                              xtables
chris@Chris-crackle:/lib$ cd modules/
chris@Chris-crackle:/lib/modules$ ls
3.19.0-25-generic  4.4.0-29-generic  4.5.3-040503-generic
3.19.0-64-generic  4.4.0-30-generic
chris@Chris-crackle:/lib/modules$ sudo rm -rf 4.5.3-040503-generic/
chris@Chris-crackle:/lib/modules$ sudo update-grub2
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-30-generic
Found initrd image: /boot/initrd.img-4.4.0-30-generic
Found linux image: /boot/vmlinuz-4.4.0-29-generic
Found initrd image: /boot/initrd.img-4.4.0-29-generic
Found linux image: /boot/vmlinuz-3.19.0-64-generic
Found initrd image: /boot/initrd.img-3.19.0-64-generic
Found linux image: /boot/vmlinuz-3.19.0-25-generic
Found initrd image: /boot/initrd.img-3.19.0-25-generic
Found Windows Boot Manager on /dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
chris@Chris-crackle:/lib/modules$ cd /
chris@Chris-crackle:/$ sudo dpkg -i dkms*.deb rtlwifi*.deb
(Reading database ... 315543 files and directories currently installed.)
Preparing to unpack dkms_2.2.0.3-2ubuntu11_all.deb ...
Unpacking dkms (2.2.0.3-2ubuntu11) over (2.2.0.3-2ubuntu11) ...
Preparing to unpack rtlwifi-new-dkms_0.10_all.deb ...

------------------------------
Deleting module version: 0.10
completely from the DKMS tree.
------------------------------
Done.
Unpacking rtlwifi-new-dkms (0.10) over (0.10) ...
Setting up dkms (2.2.0.3-2ubuntu11) ...
Setting up rtlwifi-new-dkms (0.10) ...
Loading new rtlwifi-new-0.10 DKMS files...
First Installation: checking all kernels...
It is likely that 4.5.3-040503-generic belongs to a chroot's host
Building only for 4.4.0-30-generic
Building for architecture x86_64
Building initial module for 4.4.0-30-generic
Done.

rtl_pci:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

rtl_usb.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

rtlwifi.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

btcoexist.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

rtl8188ee.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

rtl8192c-common.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

rtl8192ce.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

rtl8192cu.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

rtl8192de.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

rtl8192ee.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

rtl8192se.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

rtl8723ae.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

rtl8723be.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

rtl8821ae.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.4.0-30-generic/updates/dkms/

depmod........

Backing up initrd.img-4.4.0-30-generic to /boot/initrd.img-4.4.0-30-generic.old-dkms
Making new initrd.img-4.4.0-30-generic
(If next boot fails, revert to initrd.img-4.4.0-30-generic.old-dkms image)
update-initramfs....

DKMS: install completed.
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for initramfs-tools (0.122ubuntu8.1) ...
update-initramfs: Generating /boot/initrd.img-4.5.3-040503-generic
WARNING: missing /lib/modules/4.5.3-040503-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.5.3-040503-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_xlAFmF/lib/modules/4.5.3-040503-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_xlAFmF/lib/modules/4.5.3-040503-generic/modules.builtin: No such file or directory

答案1

差不多了,你只需要删除你删除的内核的 initrd.img 的地址/var/lib/initramfs.tools

sudo rm /var/lib/initramfs-tools/4.5.3-040503-generic

这将停止update-initramfs(由您所做的模块更改调用)尝试为不存在的内核重新生成 initrd。

之后再次运行安装命令以完成配置。

相关内容