0

I am using Ubuntu 14.04. When I run sudo apt-get autoremove, it generated the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-extra-4.4.0-34-generic (4.4.0-34.53~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-34-generic /boot/vmlinuz-4.4.0-34-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-34-generic /boot/vmlinuz-4.4.0-34-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-34-generic /boot/vmlinuz-4.4.0-34-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-34-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-34-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-34-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-generic-lts-xenial:
 linux-image-generic-lts-xenial depends on linux-image-extra-4.4.0-34-generic; however:
  Package linux-image-extra-4.4.0-34-generic is not configured yet.

dpkg: error processing package linux-image-generic-lts-xenial (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-lts-xenial:
 linux-generic-lts-xenial depends on linux-image-generic-lts-xenial (= 4.4.0.34.24); however:
  Package linux-image-generic-lts-xenial is not configured yet.

dpkg: error processing package linux-generic-lts-xenial (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-image-generic-lts-xenial:
 linux-signed-image-generic-lts-xenial depends on linux-image-extra-4.4.0-34-generic; however:
  Package linux-image-extra-4.4.0-34-generic is not configured yet.

dpkg: error processing package linux-signeNo apport report written because the error message indicates its a followup error from a previous failure.
                                                                    No apport report written because the error message indicates its a followup error from a previous failure.
              No apport report written because MaxReports is reached already
                                                                            No apport report written because MaxReports is reached already
                                                          d-image-generic-lts-xenial (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-generic-lts-xenial:
 linux-signed-generic-lts-xenial depends on linux-signed-image-generic-lts-xenial (= 4.4.0.34.24); however:
  Package linux-signed-image-generic-lts-xenial is not configured yet.

dpkg: error processing package linux-signed-generic-lts-xenial (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-extra-4.4.0-34-generic
 linux-image-generic-lts-xenial
 linux-generic-lts-xenial
 linux-signed-image-generic-lts-xenial
 linux-signed-generic-lts-xenial
E: Sub-process /usr/bin/dpkg returned an error code (1)

Also, there is a warning saying “The volume boot has only 0 bytes disk space remaining”. I was trying the answers from here. Then I got

linux-image-3.19.0-58-generic
linux-image-3.19.0-59-generic
linux-image-3.19.0-61-generic
linux-image-3.19.0-64-generic
linux-image-3.19.0-65-generic
linux-image-3.19.0-66-generic
linux-image-4.4.0-34-generic

I am not sure if it will be safe to remove all linux-image-3.19.0-xx-generic kernels. Should I keep some? Thanks.

Edit:

output of blkid -o list:

device     fs_type label    mount point    UUID
-------------------------------------------------------------------------------
/dev/ram0                   (not mounted)  
/dev/ram1                   (not mounted)  
/dev/ram2                   (not mounted)  
/dev/ram3                   (not mounted)  
/dev/ram4                   (not mounted)  
/dev/ram5                   (not mounted)  
/dev/ram6                   (not mounted)  
/dev/ram7                   (not mounted)  
/dev/ram8                   (not mounted)  
/dev/ram9                   (not mounted)  
/dev/ram10                  (not mounted)  
/dev/ram11                  (not mounted)  
/dev/ram12                  (not mounted)  
/dev/ram13                  (not mounted)  
/dev/ram14                  (not mounted)  
/dev/ram15                  (not mounted)  
/dev/sda1                   (not mounted)  
/dev/sdb1                   /boot/efi      
/dev/sdb2                   /boot          
/dev/sdb3                   (not mounted)  
/dev/mapper/ubuntu--vg-root
                            /              
/dev/mapper/ubuntu--vg-swap_1
                            <swap>         
Gejun
  • 123

3 Answers3

1

You only need to keep the 3.19.x kernels if you have problems with the 4.4.x kernels or want to boot an older kernel for some other reason. Otherwise it's safe to remove them.

0

Here is my interpretation: The first error reported seems to be "gzip: stdout: No space left on device" and then an installation fails (probably related to this out of space error). It is followed by a cascade of dependency issues, since installation of this first package fails.

How many partitions do you have? If you have separate partitions for /home and /, it might happen that you see some available space on the drive but still get an out of space notice since the available space is on a different partition.

Copper
  • 151
0

Even if you try to remove some kernels, you will get those errors, because it still needs a small portion of storage in /boot to clear kernels.

My suggestion is creating an Ubuntu Live USB, booting from it and move 1 or 2 kernel image to another location. Make sure you don't remove those which you will boot. I suggest keeping linux-image-3.19.0-66-generic kernel.

After making some room, boot to regular Ubuntu, and remove other kernels you didn't moved manually. This way you will get some room cleanly. Then again boot using USB and put those moved kernel files in their location.

Now, again boot to regular Ubuntu and remove unnecessary kernels, keeping only one. You should be to do so without any warning.

Anwar
  • 77,855