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.

I am using ubuntu 12.04LTS and whenever I use

sudo apt-get remove
sudo apt-get install

it replies

cp: failed to extend `/boot/initrd.img-3.5.0-47-generic.dpkg-bak': No space left on device
dpkg: error processing initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

is this wright? Is it installing/removing?

The reply for

sudo apt-get install -f

is

Reading package lists... Done Building dependency tree
Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up initramfs-tools (0.99ubuntu13.4) ... update-initramfs: deferring update (trigger activated) Processing triggers for initramfs-tools ... ln: failed to create hard link /boot/initrd.img-3.5.0-47-generic.dpkg-bak' =>/boot/initrd.img-3.5.0-47-generic': Operation not permitted cp: writing /boot/initrd.img-3.5.0-47-generic.dpkg-bak': No space left on device cp: failed to extend/boot/initrd.img-3.5.0-47-generic.dpkg-bak': No space left on device dpkg: error processing initramfs-tools (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: initramfs-tools E: Sub-process /usr/bin/dpkg returned an error code (1)

share|improve this question
    
post only the output of sudo apt-get install -f –  Avinash Raj Mar 7 at 18:45

2 Answers 2

up vote 2 down vote accepted

Your errors said:

No space left on device

Open System Monitor from Dash and select the Filesystems tab.

enter image description here

And if the problem is only related to /boot partition try this:

sudo apt-get autoremove

If it didn't work then It seems you have no space in /boot

You've a lot unused kernels. Remove all but the last kernels with:

sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")
share|improve this answer
    
i got the same reply :( –  Jatttt Mar 8 at 7:50
    
@user222588 can you tell me how many space left do you have –  kamil Mar 8 at 7:54
    
well in /boot 0 bytes –  Jatttt Mar 8 at 7:58
cp: failed to extend `/boot/initrd.img-3.5.0-47-generic.dpkg-bak': No space left on device

You have to free up the /boot partition.Remove all the old unused kernals.

See How do I free up more space in /boot?

share|improve this answer

Your Answer

 
discard

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.