需要帮助删除 linux-image-3.16.0-34-generic 和 linux-image-extra-3.16.0-34-generic

需要帮助删除 linux-image-3.16.0-34-generic 和 linux-image-extra-3.16.0-34-generic

所以我觉得自己像个傻瓜,不得不发布这个帖子,但我需要帮助来解决这个问题,主要是因为如果不修复,我无法安装任何新软件或运行更新。由于某种原因,其中一个内核肯定没有完全卸载(linux-image-3.16.0-34-generic),所以我尝试做我想到的第一件事:apt-get -f install... 失败并给出以下信息:

cictrone@cictrone:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-3.16.0-34-generic linux-image-extra-3.16.0-34-generic
0 upgraded, 0 newly installed, 2 to remove and 14 not upgraded.
7 not fully installed or removed.
After this operation, 201 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 241430 files and directories currently installed.)
Removing linux-image-extra-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
depmod: ERROR: could not open directory /lib/modules/3.16.0-34-generic:No such file or directory
depmod: FATAL: could not search modules: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
Error! echo
Your kernel headers for kernel 3.16.0-34-generic cannot be found at
/lib/modules/3.16.0-34-generic/build or /lib/modules/3.16.0-34-generic/source.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-34-generic
grep: /boot/config-3.16.0-34-generic: No such file or directory
WARNING: missing /lib/modules/3.16.0-34-generic
Device driver support needs thus be built-in linux image!
depmod: ERROR: could not open directory /lib/modules/3.16.0-34-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_raVmra/lib/modules/3.16.0-34-generic/modules.order: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_raVmra/lib/modules/3.16.0-34-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home    /cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-3.16.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
update-initramfs: Deleting /boot/initrd.img-3.16.0-34-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.16.0-34-generic.postrm line 328.
dpkg: error processing package linux-image-3.16.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-3.16.0-34-generic
 linux-image-3.16.0-34-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

我也尝试过:

  1. sudo dpkg-C
  2. sudo apt-get 自动删除
  3. sudo dpkg--remove
  4. sudo dpkg--configure-a
  5. sudo dpkg --remove --force-remove-reinstreq
  6. sudo apt-get 自动清理

我的 uname -r 的输出:

3.16.0-41-generic

Terrance 的建议的输出:

cictrone@cictrone:~$ sudo apt-get install linux-image-3.16.0-34-generic linux-headers-3.16.0-34-generic linux-image-extra-3.16.0-34-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-3.16.0-34-generic is already the newest version.
linux-image-3.16.0-34-generic is already the newest version.    
linux-image-extra-3.16.0-34-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
7 not fully installed or removed.
Need to get 0 B/53.9 MB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
dpkg: error processing package linux-image-3.16.0-34-generic (--configure):
 package linux-image-3.16.0-34-generic is not ready for configuration
 cannot configure (current status `half-installed')
Setting up linux-image-3.16.0-43-generic (3.16.0-43.58~14.04.1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
initrd.img(/boot/initrd.img-3.16.0-43-generic) points to /boot/initrd.img-3.16.0-43-generic
 (/boot/initrd.img-3.16.0-43-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-3.16.0-43-generic.postinst line 491.
vmlinuz(/boot/vmlinuz-3.16.0-43-generic) points to /boot/vmlinuz-3.16.0-43-generic
 (/boot/vmlinuz-3.16.0-43-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-3.16.0-43-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.16.0-43-generic.postinst line 1025.
dpkg: error processing package linux-image-3.16.0-43-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up grub-pc (2.02~beta2-9ubuntu1.3+elementary10~ubuntu0.3.1) ...
/var/lib/dpkg/info/grub-pc.config: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
dpkg: error processing package grub-pc (--configure):
 subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of linux-image-extra-3.16.0-43-generic:
 linux-image-extra-3.16.0-43-generic depends on linux-image-3.16.0-43-generic; however:
  Package linux-image-3.16.0-43-generic is not configured yet.

dpkg: error processing package linux-image-extra-3.16.0-43-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic-lts-utopic:
 linux-image-generic-lts-utopic depends on linux-image-3.16.0-43-generic; however:
  Package linux-image-3.16.0-43-generic is not configured yet.
 linux-image-generic-lts-utopic depends on linux-image-extra-3.16.0-43-generic; however:
  Package linux-image-extra-3.16.0-43-generic is not configured yet.

dpkg: error processing package linux-image-generic-lts-utopic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-lts-utopic:
 linux-generic-lts-utopic depends on linux-image-generic-No apport report written because MaxReports is reached already
 No apport report written because MaxReports is reached already
 No apport report written because MaxReports is reached already
 No apport report written because MaxReports is reached already
lts-utopic (= 3.16.0.43.34); however:
 Package linux-image-generic-lts-utopic is not configured yet.
dpkg: error processing package linux-generic-lts-utopic (--configure):
 dependency problems - leaving unconfigured
dpkg: error processing package linux-image-extra-3.16.0-34-generic (--configure):
 package linux-image-extra-3.16.0-34-generic is not ready for configuration
 cannot configure (current status `half-installed')
    Errors were encountered while processing:
     linux-image-3.16.0-34-generic
     linux-image-3.16.0-43-generic
     grub-pc
     linux-image-extra-3.16.0-43-generic
     linux-image-generic-lts-utopic
     linux-generic-lts-utopic
     linux-image-extra-3.16.0-34-generic
    E: Sub-process /usr/bin/dpkg returned an error code (1)

以下是发出重新安装命令(apt-get)后删除命令的输出:

cictrone@cictrone:~$ sudo apt-get remove linux-image-3.16.0-34-generic linux-headers-3.16.0-34-generic linux-image-extra-3.16.0-34-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-headers-3.16.0-34
Use 'apt-get autoremove' to remove it.
The following packages will be REMOVED:
  linux-headers-3.16.0-34-generic linux-image-3.16.0-34-generic
  linux-image-extra-3.16.0-34-generic
0 upgraded, 0 newly installed, 3 to remove and 15 not upgraded.
7 not fully installed or removed.
After this operation, 215 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 271286 files and directories currently installed.)
Removing linux-image-extra-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-3.16.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
Examining /etc/kernel/prerm.d.
run-parts: executing /etc/kernel/prerm.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
dkms: removing: bcmwl 6.30.223.248+bdcom (3.16.0-34-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  bcmwl
Version: 6.30.223.248+bdcom
Kernel:  3.16.0-34-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

wl.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.16.0-34-generic/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
update-initramfs: Deleting /boot/initrd.img-3.16.0-34-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.16.0-34-generic.postrm line 328.
dpkg: error processing package linux-image-3.16.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-headers-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
Errors were encountered while processing:
 linux-image-extra-3.16.0-34-generic
 linux-image-3.16.0-34-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

这些 ubuntu 调整工具(能够安装)也可以看到内核,但给出与终端相同的错误。

任何帮助都将不胜感激,谢谢。

****解决了****

事实证明,内核问题并不是导致 aptitude 无法运行的原因。实际上是 grub。特别是以下行:

/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found

我进入文件并删除了有问题的行,然后按照 Terrence 的建议操作,一切都解决了!谢谢大家。

答案1

尝试重新安装该内核然后将其删除。

重新安装:

sudo apt-get install --reinstall linux-image-3.16.0-34-generic linux-headers-3.16.0-34-generic linux-image-extra-3.16.0-34-generic

消除:

sudo apt-get remove linux-image-3.16.0-34-generic linux-headers-3.16.0-34-generic linux-image-extra-3.16.0-34-generic

答案2

Ubuntu 调整试试吧。它能很好地帮我删除旧内核。

答案3

运行内核是什么?

你需要注意这一点:

run-parts: executing /etc/kernel/prerm.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
dkms: removing: bcmwl 6.30.223.248+bdcom (3.16.0-34-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  bcmwl
Version: 6.30.223.248+bdcom
Kernel:  3.16.0-34-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

相关内容