清理内核总是会遇到问题,但不知何故我总能成功。这次我不行了!我似乎无法删除任何旧内核。
现在当我尝试时会发生以下情况sudo apt-get install 4.4.0-53-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'linux-signed-image-4.4.0-53-generic' for regex '4.4.0-53-generic'
Note, selecting 'linux-cloud-tools-4.4.0-53-generic' for regex '4.4.0-53-generic'
Note, selecting 'linux-image-extra-4.4.0-53-generic' for regex '4.4.0-53-generic'
Note, selecting 'linux-tools-4.4.0-53-generic' for regex '4.4.0-53-generic'
Note, selecting 'linux-headers-4.4.0-53-generic' for regex '4.4.0-53-generic'
Note, selecting 'linux-image-4.4.0-53-generic' for regex '4.4.0-53-generic'
linux-cloud-tools-4.4.0-53-generic is already the newest version.
linux-headers-4.4.0-53-generic is already the newest version.
linux-image-4.4.0-53-generic is already the newest version.
linux-image-extra-4.4.0-53-generic is already the newest version.
linux-signed-image-4.4.0-53-generic is already the newest version.
linux-tools-4.4.0-53-generic is already the newest version.
The following packages were automatically installed and are no longer required:
linux-image-4.4.0-47-generic linux-image-extra-4.4.0-47-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up linux-image-extra-4.4.0-53-generic (4.4.0-53.74~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-53-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-53-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-53-generic (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-generic-lts-xenial:
linux-image-generic-lts-xenial depends on linux-image-extra-4.4.0-53-generic; however:
Package linux-image-extra-4.4.0-53-generic is not configured yet.
dpkg: error processing package linux-image-generic-lts-xenial (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
linux-image-extra-4.4.0-53-generic
linux-image-generic-lts-xenial
E: Sub-process /usr/bin/dpkg returned an error code (1)
odermy@elda:~$ sudo apt-get install 4.4.0-53-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'linux-signed-image-4.4.0-53-generic' for regex '4.4.0-53-generic'
Note, selecting 'linux-cloud-tools-4.4.0-53-generic' for regex '4.4.0-53-generic'
Note, selecting 'linux-image-extra-4.4.0-53-generic' for regex '4.4.0-53-generic'
Note, selecting 'linux-tools-4.4.0-53-generic' for regex '4.4.0-53-generic'
Note, selecting 'linux-headers-4.4.0-53-generic' for regex '4.4.0-53-generic'
Note, selecting 'linux-image-4.4.0-53-generic' for regex '4.4.0-53-generic'
linux-cloud-tools-4.4.0-53-generic is already the newest version.
linux-headers-4.4.0-53-generic is already the newest version.
linux-image-4.4.0-53-generic is already the newest version.
linux-image-extra-4.4.0-53-generic is already the newest version.
linux-signed-image-4.4.0-53-generic is already the newest version.
linux-tools-4.4.0-53-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up linux-image-extra-4.4.0-53-generic (4.4.0-53.74~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-53-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-53-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-53-generic (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-generic-lts-xenial:
linux-image-generic-lts-xenial depends on linux-image-extra-4.4.0-53-generic; however:
Package linux-image-extra-4.4.0-53-generic is not configured yet.
dpkg: error processing package linux-image-generic-lts-xenial (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
linux-image-extra-4.4.0-53-generic
linux-image-generic-lts-xenial
E: Sub-process /usr/bin/dpkg returned an error code (1)
或者
我也试过sudo dpkg --configure -a
Setting up linux-image-extra-4.4.0-53-generic (4.4.0-53.74~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-53-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-53-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-53-generic (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-generic-lts-xenial:
linux-image-generic-lts-xenial depends on linux-image-extra-4.4.0-53-generic; however:
Package linux-image-extra-4.4.0-53-generic is not configured yet.
dpkg: error processing package linux-image-generic-lts-xenial (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-extra-4.4.0-53-generic
linux-image-generic-lts-xenial
和sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-extra-4.4.0-53-generic (4.4.0-53.74~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-53-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-53-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-53-generic (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-generic-lts-xenial:
linux-image-generic-lts-xenial depends on linux-image-extra-4.4.0-53-generic; however:
Package linux-image-extra-4.4.0-53-generic is not configured yet.
dpkg: error processing package linux-image-generic-lts-xenial (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
linux-image-extra-4.4.0-53-generic
linux-image-generic-lts-xenial
E: Sub-process /usr/bin/dpkg returned an error code (1)
这是我的/etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
我不知道我的引述有多大帮助,但我已尝试发布在类似情况下被问到的所有内容。
提前致谢,如果我的问题是由于我的愚蠢而引起的,我很抱歉!
编辑 :
我忘了发布当我尝试删除旧内核时会发生什么,sudo apt-get remove linux-image-3.13.0-92-generic
例如
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'linux-image-3.13.0-92-generic' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-extra-4.4.0-53-generic (4.4.0-53.74~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-53-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-53-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-53-generic (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-generic-lts-xenial:
linux-image-generic-lts-xenial depends on linux-image-extra-4.4.0-53-generic; however:
Package linux-image-extra-4.4.0-53-generic is not configured yet.
dpkg: error processing package linux-image-generic-lts-xenial (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
linux-image-extra-4.4.0-53-generic
linux-image-generic-lts-xenial
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
你的启动分区已满
update-initramfs: Generating /boot/initrd.img-4.4.0-53-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-53-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
首先删除所有旧的(未使用的)内核,然后安装新的内核,以释放一些空间。