apt 包尚未配置

apt 包尚未配置

运行 apt-get 时我得到以下输出:

 apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]?  
Setting up linux-image-2.6.32-31-server (2.6.32-31.61) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.32-31-server

gzip: stdout: No space left on device
update-initramfs: failed for /boot/initrd.img-2.6.32-31-server
Failed to create initrd image.
dpkg: error processing linux-image-2.6.32-31-server (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-server:
 linux-image-server depends on linux-image-2.6.32-31-server; however:
  Package linux-image-2.6.32-31-server is not configured yet.
dpkg: error processing linux-image-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 linux-image-2.6.32-31-server
 linux-image-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

我看到它显示“gzip:stdout:设备上没有剩余空间” - “df”显示/dev/sda1 已满。

我能做什么呢?

答案1

首先apt-get clean确保您没有一堆旧的 .deb 文件。如果这还不够,请将文件移至另一个分区或设备以释放空间。如果您没有其他分区,请将它们移至闪存驱动器或某个网络共享。我会从 /var/log 中的旧日志文件开始。

如果这还不能释放足够的空间,那么就开始卸载你不使用的软件包。或者为 /dev/sda1 文件系统上当前可移动到另一个分区(/home、/tmp 等)的大型目录腾出更多磁盘空间。


对于 /boot,这主要是软件包的内容linux-image-versionnumber。您可以删除与不打算再次使用的旧内核相关的软件包。也许每一个内核而是您当前的内核,但这是您的选择,不是我的。

要获取系统正在运行的内核版本:

root@主机:/boot# uname -r
2.6.32-27-通用

要查看linux-image-versionnumber您拥有的软件包:

root@host:/boot# dpkg -l | grep linux-image
ii linux-image-2.6.20-15-generic 2.6.20-15.27 适用于 x86/x86_64 上 2.6.20 版本的 Linux 内核映像
ii linux-image-2.6.20-16-generic 2.6.20-16.35 适用于 x86/x86_64 上 2.6.20 版本的 Linux 内核映像
ii linux-image-2.6.20-17-generic 2.6.20-17.39 适用于 x86/x86_64 上 2.6.20 版本的 Linux 内核映像
ii linux-image-2.6.22-14-386 2.6.22-14.52 适用于 i386 上 2.6.22 版本的 Linux 内核映像
ii linux-image-2.6.22-16-generic 2.6.22-16.61 适用于 x86/x86_64 上 2.6.22 版本的 Linux 内核映像
ii linux-image-2.6.24-23-generic 2.6.24-23.48 适用于 x86/x86_64 上 2.6.24 版本的 Linux 内核映像
ii linux-image-2.6.24-24-generic 2.6.24-24.53 适用于 x86/x86_64 上 2.6.24 版本的 Linux 内核映像
ii linux-image-2.6.24-25-generic 2.6.24-25.63 适用于 x86/x86_64 上 2.6.24 版本的 Linux 内核映像
ii linux-image-2.6.24-26-generic 2.6.24-26.64 适用于 x86/x86_64 上 2.6.24 版本的 Linux 内核映像
ii linux-image-2.6.24-27-generic 2.6.24-27.65 适用于 x86/x86_64 上 2.6.24 版本的 Linux 内核映像
ii linux-image-2.6.32-27-generic 2.6.32-27.49 适用于 x86/x86_64 上 2.6.32 版本的 Linux 内核映像
ii linux-image-generic 2.6.32.27.29 通用 Linux 内核映像

这里有 11 个内核包,其中 10 个我可能再也不会用了。要删除旧的包,请执行以下操作:

apt-get 删除 linux-image-2.6.20-15-generic

请勿触摸linux-image-generic,仅可触摸linux-image-versionnumber包裹。

相关内容