启动分区已满,无法删除内核

在我开始描述我的问题之前,我只是想说明我对Linux很新,所以如果我没有指出明显的话,请记住这一点。

我的Ubuntu服务器遇到了一些问题。 最初,我发现它是在连续循环中重启。 在强制关闭电源,然后拔下电源线,重新连接并执行另一次启动后,我能够成功启动服务器。 经过一番挖掘,我相信我的服务器问题的罪魁祸首是我的启动分区已满。

uname -r输出

3.16.0-41-generic

输出cat /etc/fstab

 # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # #       /dev/mapper/NUCmedia--vg-root / ext4 errors=remount-ro 0 1 # /boot was on /dev/sdb1 during installation UUID=b81a82f4-5f78-4f1e-9aaf-711ce2eb08e8 /boot ext2 defaults 0 2 /dev/mapper/NUCmedia--vg-swap_1 none swap sw 0 0 /dev/NUCmedia-vg/NUCstorage /mnt/NUCStorage ext4 defaults 0 0 

输出df -h

 Filesystem Size Used Avail Use% Mounted on /dev/mapper/NUCmedia--vg-root 29G 8.2G 20G 30% / none 4.0K 0 4.0K 0% /sys/fs/cgroup udev 3.9G 8.0K 3.9G 1% /dev tmpfs 788M 1.9M 786M 1% /run none 5.0M 0 5.0M 0% /run/lock none 3.9G 88K 3.9G 1% /run/shm none 100M 16K 100M 1% /run/user /dev/sda1 236M 233M 0 100% /boot /dev/mapper/NUCmedia--vg-NUCstorage 422G 206G 195G 52% /mnt/NUCStorage 

输出dpkg -l | grep linux-image dpkg -l | grep linux-image

 ii linux-image-3.16.0-33-generic 3.16.0-33.44~14.04.1 amd64 Linux kernel image for version 3.16.0 on 64 bit x86 SMP ii linux-image-3.16.0-34-generic 3.16.0-34.47~14.04.1 amd64 Linux kernel image for version 3.16.0 on 64 bit x86 SMP ii linux-image-3.16.0-36-generic 3.16.0-36.48~14.04.1 amd64 Linux kernel image for version 3.16.0 on 64 bit x86 SMP ii linux-image-3.16.0-37-generic 3.16.0-37.51~14.04.1 amd64 Linux kernel image for version 3.16.0 on 64 bit x86 SMP ii linux-image-3.16.0-38-generic 3.16.0-38.52~14.04.1 amd64 Linux kernel image for version 3.16.0 on 64 bit x86 SMP ii linux-image-3.16.0-39-generic 3.16.0-39.53~14.04.1 amd64 Linux kernel image for version 3.16.0 on 64 bit x86 SMP iF linux-image-3.16.0-41-generic 3.16.0-41.57~14.04.1 amd64 Linux kernel image for version 3.16.0 on 64 bit x86 SMP iF linux-image-3.16.0-43-generic 3.16.0-43.58~14.04.1 amd64 Linux kernel image for version 3.16.0 on 64 bit x86 SMP ii linux-image-extra-3.16.0-33-generic 3.16.0-33.44~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP ii linux-image-extra-3.16.0-34-generic 3.16.0-34.47~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP ii linux-image-extra-3.16.0-36-generic 3.16.0-36.48~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP ii linux-image-extra-3.16.0-37-generic 3.16.0-37.51~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP ii linux-image-extra-3.16.0-38-generic 3.16.0-38.52~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP ii linux-image-extra-3.16.0-39-generic 3.16.0-39.53~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP iU linux-image-extra-3.16.0-41-generic 3.16.0-41.57~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP iU linux-image-extra-3.16.0-43-generic 3.16.0-43.58~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP iU linux-image-extra-3.16.0-44-generic 3.16.0-44.59~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP iU linux-image-extra-3.16.0-51-generic 3.16.0-51.69~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP iU linux-image-generic-lts-utopic 3.16.0.51.42 amd64 Generic Linux kernel image 

输出如果我尝试运行以下sudo apt-get remove linux-image-3.16.0-33-generic

 no talloc stackframe at ../source3/param/loadparm.c:4864, leaking memory 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-image-extra-3.16.0-33-generic : Depends: linux-image-3.16.0-33-generic but it is not going to be installed linux-image-extra-3.16.0-44-generic : Depends: linux-image-3.16.0-44-generic but it is not going to be installed linux-image-extra-3.16.0-51-generic : Depends: linux-image-3.16.0-51-generic but it is not going to be installed linux-image-generic-lts-utopic : Depends: linux-image-3.16.0-51-generic but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

在尝试删除内核34,36等时,我似乎得到了类似的输出。

我做了很多谷歌搜索但没有提出解决方案。 有一个报告尝试'apt-get -f install' with no packages但不确定如何做或者我甚至应该尝试。

任何有关如何解决此问题的帮助或指示将非常感谢!

谢谢,

Torbuck

使用sudo dpkg -r 删除每个旧的内核包,然后通过这样做释放一些空间, sudo apt-get install -f

我最终只是将initrd.img-3.16.0-33-generic(加上34,36,37和38)移动到临时文件夹,然后能够成功执行sudo apt-get install -f 。 一旦完成,我执行了一个sudo apt-get autoremove ,它成功地释放了我的启动分区上的一些空间。 现在一切都很好!