/boot 已满,我无法清理它

/boot 已满,我无法清理它

好吧,我不知道该怎么办,我的启动已满,我通过手动删除旧内核来清理它,然后运行 ​​sudo apt-get -f install 来修复依赖关系,或者我认为,在此过程中,它尝试安装下一个内核或其他东西,但空间不足,现在我的 /boot 已满,但似乎没有任何东西需要我清理。请帮忙,这是紧急情况。

结果如下:uname -r

4.4.0-206-generic

然后我运行了这个:

dpkg -l linux-image-* | awk '/ii/{print $2}'

这给了我:

linux-image-4.4.0-200-generic
dclarke@NASBUBUNTU:~$ dpkg --list 'linux-image*' | grep ^ii
ii  linux-image-4.4.0-200-generic          4.4.0-200.232 amd64        Signed kernel image generic

因此我尝试通过运行以下命令删除 200:

sudo apt-get remove linux-image-4.4.0-200-generic

这给了我这个:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  linux-image-unsigned-4.4.0-200-generic
Suggested packages:
  fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
The following packages will be REMOVED:
  linux-image-4.4.0-200-generic linux-modules-extra-4.4.0-200-generic
The following NEW packages will be installed:
  linux-image-unsigned-4.4.0-200-generic
0 upgraded, 1 newly installed, 2 to remove and 114 not upgraded.
1 not fully installed or removed.
Need to get 7,051 kB of archives.
After this operation, 156 MB disk space will be freed.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-image-unsigned-4.4.0-200-generic amd64 4.4.0-200.232 [7,051 kB]
Fetched 7,051 kB in 0s (10.6 MB/s)
(Reading database ... 194153 files and directories currently installed.)
Removing linux-modules-extra-4.4.0-200-generic (4.4.0-200.232) ...
Removing linux-image-4.4.0-200-generic (4.4.0-200.232) ...
/etc/kernel/prerm.d/dkms:
DKMS: Starting autoremove for kernel: 4.4.0-200-generic
DKMS: removing: rapidrecovery-vss 6.1.3.100 (4.4.0-200-generic) (x86_64)

cp: error writing '/boot/initrd.img-4.4.0-200-generic.old-dkms': No space left on device
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.4.0-200-generic
/etc/kernel/postrm.d/x-grub-legacy-ec2:
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /vmlinuz-4.4.0-206-generic
Found kernel: /vmlinuz-4.4.0-201-generic
Found kernel: /vmlinuz-4.4.0-200-generic
Replacing config file /run/grub/menu.lst with new version
Found kernel: /vmlinuz-4.4.0-206-generic
Found kernel: /vmlinuz-4.4.0-201-generic
Replacing config file /run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-206-generic
Found initrd image: /boot/initrd.img-4.4.0-206-generic
Found linux image: /boot/vmlinuz-4.4.0-201-generic
done
Selecting previously unselected package linux-image-unsigned-4.4.0-200-generic.
(Reading database ... 189722 files and directories currently installed.)
Preparing to unpack .../linux-image-unsigned-4.4.0-200-generic_4.4.0-200.232_amd64.deb ...
Unpacking linux-image-unsigned-4.4.0-200-generic (4.4.0-200.232) ...
Setting up linux-image-4.4.0-201-generic (4.4.0-201.233) ...
I: /initrd.img is now a symlink to boot/initrd.img-4.4.0-201-generic
Setting up linux-image-unsigned-4.4.0-200-generic (4.4.0-200.232) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-4.4.0-201-generic
I: /vmlinuz is now a symlink to boot/vmlinuz-4.4.0-200-generic
I: /initrd.img is now a symlink to boot/initrd.img-4.4.0-200-generic
Processing triggers for linux-image-4.4.0-201-generic (4.4.0-201.233) ...
/etc/kernel/postinst.d/dkms:
DKMS: Starting post-install script on kernel 4.4.0-201-generic
DKMS: Error: Linux headers are missing, Will not continue autoinstall process.
      Please install the linux-headers-4.4.0-201-generic package and run command '/usr/lib/dkms/dkms_autoinstaller 4.4.0-201-generic' manually.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.4.0-201-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
/etc/kernel/postinst.d/x-grub-legacy-ec2:
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /vmlinuz-4.4.0-206-generic
Found kernel: /vmlinuz-4.4.0-201-generic
Replacing config file /run/grub/menu.lst with new version
Found kernel: /vmlinuz-4.4.0-206-generic
Found kernel: /vmlinuz-4.4.0-201-generic
Found kernel: /vmlinuz-4.4.0-200-generic
Replacing config file /run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-206-generic
Found initrd image: /boot/initrd.img-4.4.0-206-generic
Found linux image: /boot/vmlinuz-4.4.0-201-generic
Found initrd image: /boot/initrd.img-4.4.0-201-generic
Found linux image: /boot/vmlinuz-4.4.0-200-generic
sed: couldn't flush stdout: No space left on device
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 4
dpkg: error processing package linux-image-4.4.0-201-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for linux-image-unsigned-4.4.0-200-generic (4.4.0-200.232) ...
/etc/kernel/postinst.d/dkms:
DKMS: Starting post-install script on kernel 4.4.0-200-generic
Warning: Unable to find an initial ram disk that I know how to handle.
Will not try to make an initrd.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.4.0-200-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
cat: write error: No space left on device
update-initramfs: failed for /boot/initrd.img-4.4.0-200-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-unsigned-4.4.0-200-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)

如果我只是尝试运行:

sudo apt-get autoremove

我得到以下信息:

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 114 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-4.4.0-201-generic (4.4.0-201.233) ...
I: /initrd.img.old is now a symlink to boot/initrd.img-4.4.0-201-generic
Setting up linux-image-unsigned-4.4.0-200-generic (4.4.0-200.232) ...
I: /initrd.img is now a symlink to boot/initrd.img-4.4.0-200-generic
Processing triggers for linux-image-4.4.0-201-generic (4.4.0-201.233) ...
/etc/kernel/postinst.d/dkms:
DKMS: Starting post-install script on kernel 4.4.0-201-generic
DKMS: Error: Linux headers are missing, Will not continue autoinstall process.
      Please install the linux-headers-4.4.0-201-generic package and run command '/usr/lib/dkms/dkms_autoinstaller 4.4.0-201-generic' manually.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.4.0-201-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
cat: write error: No space left on device
update-initramfs: failed for /boot/initrd.img-4.4.0-201-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-4.4.0-201-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for linux-image-unsigned-4.4.0-200-generic (4.4.0-200.232) ...
/etc/kernel/postinst.d/dkms:
DKMS: Starting post-install script on kernel 4.4.0-200-generic
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.4.0-200-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
cat: write error: No space left on device
update-initramfs: failed for /boot/initrd.img-4.4.0-200-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-unsigned-4.4.0-200-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 linux-image-4.4.0-201-generic
 linux-image-unsigned-4.4.0-200-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

任何帮助将不胜感激。

提前致谢。

答案1

好吧,看来我的问题实际上是所有旧的 initrd.img 文件都留在 /boot 中,即使在我清理旧内核之后,我仍然只能恢复 5% 的 /boot。当我使用 ls 查看 /boot 驱动器时,我注意到有几十个旧的 initrdimg 文件,并按照以下帖子来帮助修复

是否有未使用的“initrd.img”需要删除?

我的 /boot 上现在有 82% :)

谢谢

相关内容