Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

Help - I have purged the current Kernel (linux-image-2.6.32-43-server) and cannot reinstall because the boot sector is full. How can I clear the boot sector to reinstall the kernel?

$ ls /boot
abi-2.6.32-44-server         initrd.img-3.2.0-39-generic
abi-3.2.0-34-generic         initrd.img-3.2.0-40-generic
abi-3.2.0-35-generic         initrd.img-3.2.0-41-generic
abi-3.2.0-36-generic         lost+found
abi-3.2.0-37-generic         memtest86+.bin
abi-3.2.0-38-generic         memtest86+_multiboot.bin
abi-3.2.0-39-generic         System.map-2.6.32-44-server
abi-3.2.0-40-generic         System.map-3.2.0-34-generic
abi-3.2.0-41-generic         System.map-3.2.0-35-generic
config-2.6.32-44-server      System.map-3.2.0-36-generic
config-3.2.0-34-generic      System.map-3.2.0-37-generic
config-3.2.0-35-generic      System.map-3.2.0-38-generic
config-3.2.0-36-generic      System.map-3.2.0-39-generic
config-3.2.0-37-generic      System.map-3.2.0-40-generic
config-3.2.0-38-generic      System.map-3.2.0-41-generic
config-3.2.0-39-generic      vmcoreinfo-2.6.32-44-server
config-3.2.0-40-generic      vmlinuz-2.6.32-44-server
config-3.2.0-41-generic      vmlinuz-3.2.0-34-generic
grub                         vmlinuz-3.2.0-35-generic
initrd.img-2.6.32-44-server  vmlinuz-3.2.0-36-generic
initrd.img-3.2.0-34-generic  vmlinuz-3.2.0-37-generic
initrd.img-3.2.0-35-generic  vmlinuz-3.2.0-38-generic
initrd.img-3.2.0-36-generic  vmlinuz-3.2.0-39-generic
initrd.img-3.2.0-37-generic  vmlinuz-3.2.0-40-generic
initrd.img-3.2.0-38-generic  vmlinuz-3.2.0-41-generic


$ sudo apt-get purge linux-image-3.2.0-3*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'linux-image-3.2.0-38-lowlatency' for regex 'linux-image-3.2.0-3*'
Note, selecting 'linux-image-3.2.0-1615-armadaxp' for regex 'linux-image-3.2.0-3*'
[...CUT...]

    Package linux-image-3.2.0-39-lowlatency is not installed, so not removed
    Package linux-image-3.2.0-40-lowlatency is not installed, so not removed
    Package linux-image-3.2.0-41-lowlatency is not installed, so not removed
    You might want to run 'apt-get -f install' to correct these:
    The following packages have unmet dependencies.
    linux-image-server : Depends: linux-image-3.2.0-43-generic but it is not going to be installed
    E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

DPKG OUTPUT

$ dpkg-query -l linux-image*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
un  linux-image    <none>         (no description available)
un  linux-image-2. <none>         (no description available)
un  linux-image-2. <none>         (no description available)
un  linux-image-2. <none>         (no description available)
un  linux-image-2. <none>         (no description available)
un  linux-image-2. <none>         (no description available)
un  linux-image-2. <none>         (no description available)
un  linux-image-2. <none>         (no description available)
un  linux-image-2. <none>         (no description available)
un  linux-image-2. <none>         (no description available)
un  linux-image-2. <none>         (no description available)
un  linux-image-2. <none>         (no description available)
rc  linux-image-2. 2.6.32-34.77   Linux kernel image for version 2.6.32 on x86
rc  linux-image-2. 2.6.32-35.78   Linux kernel image for version 2.6.32 on x86
rc  linux-image-2. 2.6.32-36.79   Linux kernel image for version 2.6.32 on x86
rc  linux-image-2. 2.6.32-37.81   Linux kernel image for version 2.6.32 on x86
rc  linux-image-2. 2.6.32-38.83   Linux kernel image for version 2.6.32 on x86
rc  linux-image-2. 2.6.32-39.86   Linux kernel image for version 2.6.32 on x86
rc  linux-image-2. 2.6.32-40.87   Linux kernel image for version 2.6.32 on x86
rc  linux-image-2. 2.6.32-41.91   Linux kernel image for version 2.6.32 on x86
rc  linux-image-2. 2.6.32-42.96   Linux kernel image for version 2.6.32 on x86
rc  linux-image-2. 2.6.32-43.97   Linux kernel image for version 2.6.32 on x86
ii  linux-image-2. 2.6.32-44.98   Linux kernel image for version 2.6.32 on x86
un  linux-image-3. <none>         (no description available)
ii  linux-image-3. 3.2.0-34.53    Linux kernel image for version 3.2.0 on 64 b
ii  linux-image-3. 3.2.0-35.55    Linux kernel image for version 3.2.0 on 64 b
ii  linux-image-3. 3.2.0-36.57    Linux kernel image for version 3.2.0 on 64 b
ii  linux-image-3. 3.2.0-37.58    Linux kernel image for version 3.2.0 on 64 b
ii  linux-image-3. 3.2.0-38.61    Linux kernel image for version 3.2.0 on 64 b
ii  linux-image-3. 3.2.0-39.62    Linux kernel image for version 3.2.0 on 64 b
ii  linux-image-3. 3.2.0-40.64    Linux kernel image for version 3.2.0 on 64 b
ii  linux-image-3. 3.2.0-41.66    Linux kernel image for version 3.2.0 on 64 b
in  linux-image-3. <none>         (no description available)
iU  linux-image-se 3.2.0.43.51    Linux kernel image on Server Equipment.
share|improve this question

marked as duplicate by mikewhatever, Thomas W., Eric Carvalho, aquaherd, Mateo_ May 19 '13 at 0:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Boot sector full? You mean the boot partition? Post df -h please –  grimpitch May 17 '13 at 9:09
    
/dev/sda1 228M 226M 0 100% /boot –  Hercule May 17 '13 at 9:13
    
Sorry about that - I'm in a bit of a panic. I also think my current kernel is 3.2.0-40-generic according to uname-r. –  Hercule May 17 '13 at 9:15
    
Ok, don't panic, you have a separate /boot partition, that is good thing. Just check how many kernels are installed and what versions. ls /boot –  grimpitch May 17 '13 at 9:18
1  
You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies. linux-image-server : Depends: linux-image-3.2.0-43-generic but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). –  Hercule May 17 '13 at 10:03

1 Answer 1

I just had the same problem. The only thing that helped was manually removing enough files in /boot using

cd /boot
rm initrd.img-3.2.0-24-generic-pae initrd.img-3.2.0-29-generic-pae

for

apt-get -f install

to be able to complete normally. Then use

 dpkg --list|grep linux-image

to identify linux images and remove enough of the oldes with e.g.

apt-get purge linux-image-3.2.0-24-generic-pae linux-image-3.2.0-29-generic-pae ...

Finally there might be some extra space to reclaim with

apt-get autoclean
apt-get autoremove

(I derived the above from other answers - this was was worked for me)

I believe that I've seen that Ubuntu now has some "clean up old kernels" functionality, but apparently it did not kick in here.

share|improve this answer
    
Aha! I deleted an older kernel physically and that allowed me to run apt-get -f install. I am now freeing up some of the older Kernels. Many thanks. –  Hercule May 17 '13 at 10:46

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