0

I've got a strange error preventing me from installing anything on my Debian box.

When I run apt-get upgrade (or apt-get install) it produces this error message:

# apt-get upgrade
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.

If I do at it tells me - to run dpkg --configure -a it produces the following output:

# dpkg --configure -a
Setting up initramfs-tools (0.93.4) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.26-2-686

gzip: stdout: No space left on device
update-initramfs: failed for /boot/initrd.img-2.6.26-2-686
dpkg: subprocess installed post-installation script returned error exit status 1

If I do a df -h /boot it shows that the partition is almost full:

# df -h /boot
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              38M   31M  5.5M  85% /boot

If I check the directory it seems that quite a lot of the stuff is duplicated:

# ls -la /boot
total 26495
drwxr-xr-x  4 root root    1024 2009-11-02 05:00 .
drwxr-xr-x 22 root root    4096 2009-10-25 07:46 ..
-rw-r--r--  1 root root   70682 2009-08-20 23:14 config-2.6.18-6-686
-rw-r--r--  1 root root   91690 2009-08-19 11:49 config-2.6.26-2-686
drwxr-xr-x  2 root root    1024 2009-09-20 15:48 grub
-rw-r--r--  1 root root 4495693 2009-09-20 15:32 initrd.img-2.6.18-6-686
-rw-r--r--  1 root root 4495471 2008-12-18 12:50 initrd.img-2.6.18-6-686.bak
-rw-r--r--  1 root root 7175680 2009-09-20 15:54 initrd.img-2.6.26-2-686
-rw-r--r--  1 root root 6239705 2009-09-20 15:48 initrd.img-2.6.26-2-686.bak
drwx------  2 root root   12288 2008-08-29 12:21 lost+found
-rw-r--r--  1 root root  723580 2009-08-21 05:08 System.map-2.6.18-6-686
-rw-r--r--  1 root root  928010 2009-08-19 11:49 System.map-2.6.26-2-686
-rw-r--r--  1 root root 1261508 2009-08-21 05:08 vmlinuz-2.6.18-6-686
-rw-r--r--  1 root root 1506032 2009-08-19 11:48 vmlinuz-2.6.26-2-686

Can anyone help me get out of this misery? ;-)

phidah
  • 233
  • 4
  • 12

3 Answers3

3

What kernel are you currently running? You can check that via uname -a. Once you have that information, you can delete the config-, initrd.img-, System.map-, and vmlinuz- files that don't match your current kernel version.

For caution's sake, don't actually delete those files. Rather just copy them to another partition if possible.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • Linux localhost 2.6.18-6-686 #1 SMP Fri Dec 12 16:48:28 UTC 2008 i686 GNU/Linux -- So files with 2.6.18-6 must be kept? – phidah Nov 02 '09 at 04:12
  • That's correct. Womble's advice is wise, though, you really need a larger /boot. – EEAA Nov 02 '09 at 04:16
  • Also sensible to remove the packages which contain them, rather than just vaping the files themselves. Search for packages containing the files with ``dpkg -S /boot/filename'' and you'll see which one to remove. – David Gardner Nov 12 '09 at 13:43
3

As a stopgap measure, you can remove the .bak files in /boot, however I'd really recommend getting a bigger /boot partition. As you've found, 38MB is a bit slim, and the last thing you want to be doing is nuking kernels that you turn out to need.

womble
  • 96,255
  • 29
  • 175
  • 230
  • Yes, I thought about that, but isn't expanding the boot partition quite a hazardous task? – phidah Nov 02 '09 at 04:18
  • Depends on how your system is setup. Could be trivial, could be painful. I'd make sure my backups were solid and then `parted resize` to shrink the partition after `sda1`, use `parted move` to move that partition a little further along the disk, then `parted resize` again to make `sda1` bigger. – womble Nov 02 '09 at 05:24
0

Another option is also to make a new /boot partition which would be bigger not to enlarge existing one.

edgars
  • 373
  • 3
  • 8