磁盘空间不足-/boot 占 100%

磁盘空间不足-/boot 占 100%

我的 /boot 占用了 100%。运行时,aptitude search ~ilinux-image我得到了大量未使用的图像。当我尝试删除其中一个图像时(在执行 检查当前正在使用哪个图像后uname -r),例如,apt-get autoremove linux-image-3.2.0-44-generic我得到了:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-generic : Depends: linux-headers-generic (= 3.2.0.51.61) but 3.2.0.54.64 is to be installed
 linux-server : Depends: linux-headers-server (= 3.2.0.51.61) but 3.2.0.54.64 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

还有跑apt-get -f installNo space left on device。我也尝试过,apt-get purge但得到的结果是一样的。

df -h和的输出dpkg -l linux-*.

root@hb2088:/srv/www# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       9.4G  3.0G  6.0G  34% /
udev            301M  4.0K  301M   1% /dev
tmpfs           124M  228K  124M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            309M     0  309M   0% /run/shm
/dev/sda1        92M   91M     0 100% /boot
root@hb2088:/srv/www# dpkg -l linux-*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                 Version                                              Description
+++-====================================================-====================================================-========================================================================================================================
un  linux-doc-3.2.0                                      <none>                                               (no description available)
ii  linux-firmware                                       1.79.6                                               Firmware for Linux kernel drivers
iU  linux-generic                                        3.2.0.51.61                                          Complete Generic Linux kernel
un  linux-headers                                        <none>                                               (no description available)
un  linux-headers-3                                      <none>                                               (no description available)
un  linux-headers-3.0                                    <none>                                               (no description available)
ii  linux-headers-3.2.0-44                               3.2.0-44.69                                          Header files related to Linux kernel version 3.2.0
ii  linux-headers-3.2.0-44-generic                       3.2.0-44.69                                          Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
ii  linux-headers-3.2.0-45                               3.2.0-45.70                                          Header files related to Linux kernel version 3.2.0
ii  linux-headers-3.2.0-45-generic                       3.2.0-45.70                                          Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
ii  linux-headers-3.2.0-48                               3.2.0-48.74                                          Header files related to Linux kernel version 3.2.0
ii  linux-headers-3.2.0-48-generic                       3.2.0-48.74                                          Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
ii  linux-headers-3.2.0-51                               3.2.0-51.77                                          Header files related to Linux kernel version 3.2.0
ii  linux-headers-3.2.0-51-generic                       3.2.0-51.77                                          Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
ii  linux-headers-3.2.0-52                               3.2.0-52.78                                          Header files related to Linux kernel version 3.2.0
ii  linux-headers-3.2.0-52-generic                       3.2.0-52.78                                          Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
iU  linux-headers-3.2.0-54                               3.2.0-54.82                                          Header files related to Linux kernel version 3.2.0
iU  linux-headers-3.2.0-54-generic                       3.2.0-54.82                                          Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
iU  linux-headers-generic                                3.2.0.54.64                                          Generic Linux kernel headers
iU  linux-headers-server                                 3.2.0.54.64                                          Linux kernel headers on Server Equipment.
un  linux-image                                          <none>                                               (no description available)
un  linux-image-3.0                                      <none>                                               (no description available)
ii  linux-image-3.2.0-44-generic                         3.2.0-44.69                                          Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-45-generic                         3.2.0-45.70                                          Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-48-generic                         3.2.0-48.74                                          Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iF  linux-image-3.2.0-51-generic                         3.2.0-51.77                                          Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iF  linux-image-3.2.0-52-generic                         3.2.0-52.78                                          Linux kernel image for version 3.2.0 on 64 bit x86 SMP
in  linux-image-3.2.0-54-generic                         <none>                                               (no description available)
iU  linux-image-generic                                  3.2.0.51.61                                          Generic Linux kernel image
iU  linux-image-server                                   3.2.0.51.61                                          Linux kernel image on Server Equipment.
un  linux-initramfs-tool                                 <none>                                               (no description available)
un  linux-kernel-headers                                 <none>                                               (no description available)
un  linux-kernel-log-daemon                              <none>                                               (no description available)
ii  linux-libc-dev                                       3.2.0-52.78                                          Linux Kernel Headers for development
un  linux-restricted-common                              <none>                                               (no description available)
iU  linux-server                                         3.2.0.51.61                                          Complete Linux kernel on Server Equipment.
un  linux-source-3.2.0                                   <none>                                               (no description available)
un  linux-tools                                          <none>                                               (no description available)

输出du -sh /boot/*

root@hb2088:~# du -sh /boot/*
781K    /boot/abi-3.2.0-44-generic
781K    /boot/abi-3.2.0-45-generic
781K    /boot/abi-3.2.0-48-generic
781K    /boot/abi-3.2.0-51-generic
781K    /boot/abi-3.2.0-52-generic
139K    /boot/config-3.2.0-44-generic
139K    /boot/config-3.2.0-45-generic
139K    /boot/config-3.2.0-48-generic
139K    /boot/config-3.2.0-51-generic
139K    /boot/config-3.2.0-52-generic
1.6M    /boot/grub
14M /boot/initrd.img-3.2.0-44-generic
14M /boot/initrd.img-3.2.0-45-generic
14M /boot/initrd.img-3.2.0-48-generic
12K /boot/lost+found
174K    /boot/memtest86+.bin
176K    /boot/memtest86+_multiboot.bin
2.8M    /boot/System.map-3.2.0-44-generic
2.8M    /boot/System.map-3.2.0-45-generic
2.8M    /boot/System.map-3.2.0-48-generic
2.8M    /boot/System.map-3.2.0-51-generic
2.8M    /boot/System.map-3.2.0-52-generic
4.8M    /boot/vmlinuz-3.2.0-44-generic
4.8M    /boot/vmlinuz-3.2.0-45-generic
4.8M    /boot/vmlinuz-3.2.0-48-generic
4.8M    /boot/vmlinuz-3.2.0-51-generic
4.8M    /boot/vmlinuz-3.2.0-52-generic

答案1

您应该使用以下命令行删除内核:

sudo dpkg -r linux-generic linux-server
sudo apt-get autoremove --purge linux-image-3.2.0-44-generic linux-image-3.2.0-45-generic linux-image-3.2.0-48-generic linux-image-3.2.0-51-generic
sudo apt-get install linux-generic

这样就可以解决内核混乱的问题/boot。你也应该删除其他linux-headers-*软件包。

相关内容