Linux – apt Package is not configured yet

aptlinuxUbuntu

When running apt-get I get the following output:

 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)

I see that it says "gzip: stdout: No space left on device" – a "df" reveals that /dev/sda1 is full.

What can I do about this?

Best Answer

Start with apt-get clean to make sure you don't have a bunch of old .deb files sitting around. If that doesn't make enough space, move files to another partition or device to free up space. If you don't have another partition, move them to a flash drive or a network share somewhere instead. I'd start with old log files from /var/log.

If that doesn't clear up enough space, then start uninstalling packages you're not using. Or bring in more disk space for large directories currently on /dev/sda1's filesystem that can be moved to another partition (/home, /tmp, etc.)


For /boot, that's mostly the contents of linux-image-versionnumber packages. You can remove the ones associated with old kernels you don't plan to use again. Maybe that's every kernel but your current one, but that's your call, not mine.

To get the running kernel version for your system:

root@host:/boot# uname -r
2.6.32-27-generic

To see what linux-image-versionnumber packages you have:

root@host:/boot# dpkg -l | grep linux-image
ii  linux-image-2.6.20-15-generic              2.6.20-15.27                                    Linux kernel image for version 2.6.20 on x86/x86_64
ii  linux-image-2.6.20-16-generic              2.6.20-16.35                                    Linux kernel image for version 2.6.20 on x86/x86_64
ii  linux-image-2.6.20-17-generic              2.6.20-17.39                                    Linux kernel image for version 2.6.20 on x86/x86_64
ii  linux-image-2.6.22-14-386                  2.6.22-14.52                                    Linux kernel image for version 2.6.22 on i386
ii  linux-image-2.6.22-16-generic              2.6.22-16.61                                    Linux kernel image for version 2.6.22 on x86/x86_64
ii  linux-image-2.6.24-23-generic              2.6.24-23.48                                    Linux kernel image for version 2.6.24 on x86/x86_64
ii  linux-image-2.6.24-24-generic              2.6.24-24.53                                    Linux kernel image for version 2.6.24 on x86/x86_64
ii  linux-image-2.6.24-25-generic              2.6.24-25.63                                    Linux kernel image for version 2.6.24 on x86/x86_64
ii  linux-image-2.6.24-26-generic              2.6.24-26.64                                    Linux kernel image for version 2.6.24 on x86/x86_64
ii  linux-image-2.6.24-27-generic              2.6.24-27.65                                    Linux kernel image for version 2.6.24 on x86/x86_64
ii  linux-image-2.6.32-27-generic              2.6.32-27.49                                    Linux kernel image for version 2.6.32 on x86/x86_64
ii  linux-image-generic                        2.6.32.27.29                                    Generic Linux kernel image

Here, I've got 11 kernel packages, 10 of which I'm never likely to use again. To remove an old one:

apt-get remove linux-image-2.6.20-15-generic

Don't touch linux-image-generic, just the linux-image-versionnumber packages.

Related Topic