删除内核 4.8.0-39 时出错

删除内核 4.8.0-39 时出错

有一天我选择安装内核 4.8.0-39 但它没有安装并返回错误,我没有给它一个值。但现在我想安装更新并终端显示与之相关的错误,检查我接下来找到的 /var/lib/dkms/ndiswrapper/1.59/build/make.log 文件:

/var/lib/dkms/ndiswrapper/1.59/build/wrapndis.c: In function ‘tx_worker’:
/var/lib/dkms/ndiswrapper/1.59/build/wrapndis.c:707:16: error: ‘struct net_device’ has no member named ‘trans_start’
    wnd->net_dev->trans_start = jiffies;
                ^
scripts/Makefile.build:289: recipe for target «/var/lib/dkms/ndiswrapper/1.59/build/wrapndis.o» failed
make[1]: *** [/var/lib/dkms/ndiswrapper/1.59/build/wrapndis.o] Error 1
Makefile:1491: recipe for target «_module_/var/lib/dkms/ndiswrapper/1.59/build» failed
make: *** [_module_/var/lib/dkms/ndiswrapper/1.59/build] Error 2
make: exit from directory «/usr/src/linux-headers-4.8.0-39-generic»

如果我理解正确,内核无法编译并返回错误,因为所有升级都会崩溃。我需要做什么才能删除所有有关 4.8.0-39 内核的内容?

我已经尝试过运行:

  1. sudo apt-get install --reinstall linux-headers-4.8.0-39-generic

  2. sudo apt autoremove

  3. sudo dpkg --configure -a

  4. sudo apt-get install -f

  5. sudo apt remove linux-headers-4.8.0-39

每次我得到这个:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'linux-headers-4.8.0-39' is not installed, so not removed
The following packages will be REMOVED:
  linux-image-extra-4.8.0-39-generic
0 upgraded, 0 newly installed, 1 to remove and 43 not upgraded.
2 not fully installed or removed.
After this operation, 162 MB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 383195 files and directories currently installed.)
Removing linux-image-extra-4.8.0-39-generic (4.8.0-39.42~16.04.1) ...
depmod: FATAL: could not load /boot/System.map-4.8.0-39-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-39-generic /boot/vmlinuz-4.8.0-39-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.8.0-39-generic /boot/vmlinuz-4.8.0-39-generic
Error! echo
Your kernel headers for kernel 4.8.0-39-generic cannot be found at
/lib/modules/4.8.0-39-generic/build or /lib/modules/4.8.0-39-generic/source.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-39-generic /boot/vmlinuz-4.8.0-39-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-39-generic
Warning: No support for locale: ru_RU.utf8
depmod: WARNING: could not open /var/tmp/mkinitramfs_jTYeTT/lib/modules/4.8.0-39-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_jTYeTT/lib/modules/4.8.0-39-generic/modules.builtin: No such file or directory

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.8.0-39-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.8.0-39-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.8.0-39-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

我的系统:

Linux PCNAME 4.4.0-63-generic #84-Ubuntu SMP Wed Feb 1 17:20:32 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Distributor ID: LinuxMint
Description:    Linux Mint 18.1 Serena
Release:    18.1
Codename:   serena

编辑:

~$ ll -d /var/tmp
drwxrwxrwt 42 root root 4096 мар  2 02:12 /var/tmp/

df -h

Filesystem Size Used Avail Use% Mounted on
udev 7,7G 0 7,7G 0% /dev
tmpfs 1,6G 9,6M 1,6G 1% /run
/dev/sda2 48G 13G 34G 28% /
tmpfs 7,7G 207M 7,5G 3% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 7,7G 0 7,7G 0% /sys/fs/cgroup
/dev/sda3 268M 261M 0 100% /boot
/dev/sda4 149G 138G 8,1G 95% /home
cgmfs 100K 0 100K 0% /run/cgmanager/fs
tmpfs 1,6G 44K 1,6G 1% /run/user/1000

@Bruno9779 是的,看来你完全正确,我的/启动没有足够的空间,我忘了,/启动在另一个分区上,但我无法删除某些内容,因为apt-get尝试删除4.8.0-39首先内核并崩溃,我想手动删除一些内核,但决定在它工作时不碰任何东西。现在我有4.4.0-53 4.4.0-59 4.4.0-62 4.4.0-63 4.4.0-64安装内核并从 4.4.0-64 启动

答案1

真正的问题是:

gzip: stdout: No space left on device

通过以下方式确认问题:

df -h

由于“磁盘空间不足”而生成的错误消息通常具有误导性。

编辑:

显然你的启动分区已满。

/dev/sda3 268M 261M 0 100% /boot

在安装/重新安装任何内核之前,您需要在那里腾出一些空间。

获取已安装内核的列表:

dpkg --list | grep linux-image

获取正在运行的内核的版本号:

uname -r

现在使用包管理器删除一些未使用的内核

答案2

非常感谢所有提供帮助的人。我解决我的问题。正如 Bruno9779 所写,我需要更多可用空间/启动我备份了已安装的内核映像4.4.0-53、59、62并删除4.8.0-39之后返回备份的文件并通过突触删除它们。

相关内容