apt 包尚未配置

phi*_*dah 3 linux ubuntu 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)
Run Code Online (Sandbox Code Playgroud)

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

我该怎么办?

Mik*_*fro 6

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

如果这不能清除足够的空间,那么开始卸载您不使用的软件包。或者为当前位于 /dev/sda1 文件系统上的大目录引入更多磁盘空间,这些目录可以移动到另一个分区(/home、/tmp 等)


对于/boot,这主要是linux-image-versionnumber包的内容。您可以删除与您不打算再次使用的旧内核相关联的内核。也许这是除了你当前的内核之外的所有内核,但那是你的要求,而不是我的。

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

root@host:/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包裹。