跑步后
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get install -f
dpkg --configure -a
我收到以下错误:
dpkg --configure -a
Setting up initramfs-tools (0.112) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-3.8-2-amd64 (3.8.13-1) ...
Running depmod.
vmlinuz(/boot/vmlinuz-3.8-2-amd64
) points to /boot/vmlinuz-3.8-2-amd64
(/boot/vmlinuz-3.8-2-amd64) -- doing nothing at /var/lib/dpkg/info/linux-image-3.8-2-amd64.postinst line 268.
The link /initrd.img is a dangling linkto /boot/initrd.img-3.8-2-amd64
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.8-2-amd64 /boot/vmlinuz-3.8-2-amd64
update-initramfs: Generating /boot/initrd.img-3.8-2-amd64
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.8-2-amd64 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.8-2-amd64.postinst line 696.
dpkg: error processing linux-image-3.8-2-amd64 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-3.8-2-amd64; however:
Package linux-image-3.8-2-amd64 is not configured yet.
dpkg: error processing linux-image-amd64 (--configure):
dependency problems - leaving unconfigured
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-4-amd64
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-4-amd64 with 1.
dpkg: error processing initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
linux-image-3.8-2-amd64
linux-image-amd64
initramfs-tools
df -h 的输出
Filesystem Size Used Avail Use% Mounted on
rootfs 34G 8.4G 24G 27% /
udev 10M 0 10M 0% /dev
tmpfs 50M 220K 50M 1% /run
/dev/mapper/vg0-root 34G 8.4G 24G 27% /
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 100M 0 100M 0% /run/shm
/dev/sda2 179M 19M 151M 12% /boot
/dev/mapper/vg0-tmp 1.9G 35M 1.8G 2% /tmp
df -i 的输出
df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
rootfs 3555328 108372 3446956 4% /
udev 126899 331 126568 1% /dev
tmpfs 128378 273 128105 1% /run
/dev/sda3 3555328 108372 3446956 4% /
tmpfs 128378 4 128374 1% /run/lock
tmpfs 128378 2 128376 1% /run/shm
/dev/sda2 48672 304 48368 1% /boot
/dev/sda6 124928 21 124907 1% /tmp
/boot 的内容
ls -l /boot
total 77941
-rw-r--r-- 1 root root 106193 Feb 25 04:02 config-2.6.32-5-amd64
-rw-r--r-- 1 root root 130657 Feb 5 2012 config-3.2.0-1-amd64
-rw-r--r-- 1 root root 128954 Jun 11 2012 config-3.2.0-2-amd64
-rw-r--r-- 1 root root 128986 Jul 23 2012 config-3.2.0-3-amd64
-rw-r--r-- 1 root root 129038 May 16 00:01 config-3.2.0-4-amd64
-rw-r--r-- 1 root root 139218 May 16 15:15 config-3.8-2-amd64
drwxr-xr-x 5 root root 5120 May 22 11:58 grub
-rw-r--r-- 1 root root 9152728 Mar 3 18:16 initrd.img-2.6.32-5-amd64
-rw-r--r-- 1 root root 10103130 Mar 11 2012 initrd.img-3.2.0-1-amd64
-rw-r--r-- 1 root root 10144903 Jul 23 2012 initrd.img-3.2.0-2-amd64
-rw-r--r-- 1 root root 10153801 Nov 25 12:26 initrd.img-3.2.0-3-amd64
-rw-r--r-- 1 root root 10706204 May 22 11:56 initrd.img-3.2.0-4-amd64
drwxr-xr-x 2 root root 12288 Jan 16 2012 lost+found
-rw-r--r-- 1 root root 1667905 Feb 25 04:02 System.map-2.6.32-5-amd64
-rw-r--r-- 1 root root 2073076 Feb 5 2012 System.map-3.2.0-1-amd64
-rw-r--r-- 1 root root 2091890 Jun 11 2012 System.map-3.2.0-2-amd64
-rw-r--r-- 1 root root 2095153 Jul 23 2012 System.map-3.2.0-3-amd64
-rw-r--r-- 1 root root 2105522 May 16 00:01 System.map-3.2.0-4-amd64
-rw-r--r-- 1 root root 2278502 May 16 15:15 System.map-3.8-2-amd64
-rw-r--r-- 1 root root 2426880 Feb 25 03:59 vmlinuz-2.6.32-5-amd64
-rw-r--r-- 1 root root 2779472 Feb 5 2012 vmlinuz-3.2.0-1-amd64
-rw-r--r-- 1 root root 2819504 Jun 11 2012 vmlinuz-3.2.0-2-amd64
-rw-r--r-- 1 root root 2822928 Jul 23 2012 vmlinuz-3.2.0-3-amd64
-rw-r--r-- 1 root root 2833376 May 15 23:58 vmlinuz-3.2.0-4-amd64
-rw-r--r-- 1 root root 2429168 May 16 15:13 vmlinuz-3.8-2-amd64
答案1
我们看到df
声明仅使用了 19MB,/boot
可用空间为 151MB。但目录列表显示的文件数量远不止 19MB!
因此我猜测/boot
文件系统已损坏。
卸载并检查:
umount /boot
fsck -f /boot
答案2
这是一个典型的 ubuntu 问题(假设您安装了一堆旧内核),旧安装填满了 /boot。
查看当前内核是什么:
$ uname -a
然后安装了哪些内核:
$ aptitude search linux-image | grep '^i'
然后删除一些旧的未使用的:
$ sudo dpkg --remove linux-image-x.x.x-x-type
将 xxx-x-type 替换为第二步中的内核的实际值。然后您应该能够继续执行 apt-get install -f 步骤。