Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:
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?

share|improve this question
up vote 6 down vote accepted

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

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                                                  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.

share|improve this answer
Hmm. Seems that the /boot partition is full. Seems to be old versions of stuff laying around. How do I figure out if I can remove some of it? – phidah May 7 '11 at 12:16
Edited my answer to account for /boot. – Mike Renfro May 7 '11 at 12:32
@phidah: Generally, you need to keep the kernel you're running now and the kernel you're planning to reboot to next. The quirks of APT's dependency systems mean that it typically won't remove old kernels, you may be able to remove some manually (apt-get remove linux-image-OLD-VERSION-NUMBER). – Gilles May 7 '11 at 12:44
Thanks for the help. Problem solved ;-) – phidah May 7 '11 at 13:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.