2

I am using Ubuntu 12.04 LTS 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 right?

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)
1
  • post only the output of sudo apt-get install -f Mar 7, 2014 at 18:45

2 Answers 2

3

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]+//')")
3
  • i got the same reply :(
    – Jatttt
    Mar 8, 2014 at 7:50
  • @user222588 can you tell me how many space left do you have
    – kamil
    Mar 8, 2014 at 7:54
  • well in /boot 0 bytes
    – Jatttt
    Mar 8, 2014 at 7:58
1
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?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .