如何从我(足够大)/ boot中释放空间?


2

我正在尝试将Plex Media Server安装到我的Ubuntu服务器(14.04.2 LTS)之后 指南 但是当我开始安装Docker时,我在运行命令时遇到了以下问题 sudo apt-get install linux-image-extra-$(uname -r)

$ sudo apt-get install linux-image-extra-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-image-extra-3.13.0-53-generic is already the newest version.
linux-image-extra-3.13.0-53-generic set to manually installed.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-image-extra-3.13.0-68-generic : Depends: linux-image-3.13.0-68-generic but it is not going to be installed
 linux-image-generic : Depends: linux-image-3.13.0-68-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

然后当我尝试运行命令时 apt-get -f install 我收到以下错误:

$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-48 linux-headers-3.13.0-48-generic
  linux-headers-3.13.0-54 linux-headers-3.13.0-54-generic
  linux-image-3.13.0-48-generic linux-image-3.13.0-54-generic
  linux-image-extra-3.13.0-48-generic linux-image-extra-3.13.0-54-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-image-3.13.0-68-generic
Suggested packages:
  fdutils linux-doc-3.13.0 linux-source-3.13.0 linux-tools
The following NEW packages will be installed:
  linux-image-3.13.0-68-generic
0 upgraded, 1 newly installed, 0 to remove and 205 not upgraded.
9 not fully installed or removed.
Need to get 0 B/15.2 MB of archives.
After this operation, 42.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 316302 files and directories currently installed.)
Preparing to unpack .../linux-image-3.13.0-68-generic_3.13.0-68.111_amd64.deb ...
Done.
Unpacking linux-image-3.13.0-68-generic (3.13.0-68.111) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.13.0-68-generic_3.13.0-68.111_amd64.deb (--unpack):
 cannot copy extracted data for './boot/System.map-3.13.0-68-generic' to '/boot/System.map-3.13.0-68-generic.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.13.0-68-generic_3.13.0-68.111_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

现在,通过阅读我知道的错误信息 /boot/ 车满了,看着 $ df -h 它确实看起来很饱满。但是什么是清空驱动器的最佳方法,或者我可以移动驱动器 /boot/ 更大的分区而不影响主驱动器上的所有文件?

** 更新 **

这是我的输出方式 df -h 好像:

$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-root  1.8T  1.5T  256G  86% /
none                         4.0K     0  4.0K   0% /sys/fs/cgroup
udev                         968M  8.0K  968M   1% /dev
tmpfs                        196M  1.2M  195M   1% /run
none                         5.0M     0  5.0M   0% /run/lock
none                         980M  4.0K  980M   1% /run/shm
none                         100M     0  100M   0% /run/user
/dev/sda1                    236M  230M     0 100% /boot

而这里是我的输出 dpkg -l 'linux-image*' | grep ^ii

$ dpkg -l 'linux-image*' | grep ^ii
ii  linux-image-3.13.0-43-generic            3.13.0-43.72                         amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.13.0-46-generic            3.13.0-46.79                         amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.13.0-48-generic            3.13.0-48.80                         amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.13.0-49-generic            3.13.0-49.83                         amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.13.0-51-generic            3.13.0-51.84                         amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.13.0-52-generic            3.13.0-52.86                         amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.13.0-53-generic            3.13.0-53.89                         amd64        Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-extra-3.13.0-43-generic      3.13.0-43.72                         amd64        Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-extra-3.13.0-46-generic      3.13.0-46.79                         amd64        Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-extra-3.13.0-48-generic      3.13.0-48.80                         amd64        Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-extra-3.13.0-49-generic      3.13.0-49.83                         amd64        Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-extra-3.13.0-51-generic      3.13.0-51.84                         amd64        Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-extra-3.13.0-52-generic      3.13.0-52.86                         amd64        Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-extra-3.13.0-53-generic      3.13.0-53.89                         amd64        Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP

请发布输出 df -hdpkg -l 'linux-image*' | grep ^ii。第一个命令将为您提供一个表,显示每个已安装文件系统的可用空间和已用空间,而第二个命令将显示所有已安装内核的列表。
Larssend

谢谢。我已经用命令的输出更新了原始帖子。
Mr.Mark

Answers:


2

你的/ boot目录已满!找到并删除不再使用的旧内核并将其删除(apt-get purge linux-image-3.13.0-43-generic)。你为什么这么多?只要让一对夫妇重新开始并重新开始。这将使您的启动列表更短。


1
可能是因为 apt 为每个内核更新安装一个新包,但不会自动删除不需要的包。
grawity

@ simon-tan:当我尝试运行该命令时,我收到以下错误: 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.13.0-43-generic : Depends: linux-image-3.13.0-43-generic but it is not going to be installed linux-image-extra-3.13.0-68-generic : Depends: linux-image-3.13.0-68-generic but it is not going to be installed linux-image-generic : Depends: linux-image-3.13.0-68-generic but it is not going to be installed
Mr.Mark

尝试:apt-get purge linux-image-3.13.0-43-generic linux-image-extra-3.13.0-43-generic。其余的都做同样的事情。请记住至少保留一个(在您的计算机上运行的那个),否则您的计算机将无法启动。
simon tan

@simontan我也试过那个命令,但后来我得到了这个: 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.13.0-68-generic : Depends: linux-image-3.13.0-68-generic but it is not going to be installed linux-image-generic : Depends: linux-image-3.13.0-68-generic but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Mr.Mark

1

按照askubuntu.com上的这个指南解决了我的问题:

释放/ boot文件系统上的空间 (显然在需要的地方将相关值替换为我自己的值)

按照上面的指南后,我运行了命令 apt-get autoremove 这清理了我/ boot分区上的一大堆空间。

现在我可以运行命令了 apt-get -f install 再次。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.