3

I keep on getting an urgent error message telling me my BOOT volume is full! How can I safely clean this up? Please be aware, I am a newbie in Linux.

This is the result of uname -a:

Linux ESPRIMO-E3500 3.13.0-53-generic #89-Ubuntu SMP Wed May 20 10:34:28 UTC 2015 i686 i686 i686 GNU/Linux

I installed the Synaptic package manager and looked at the status window "Auto Removable":
There are things like System.map-3.13.0-46-generic

But which of them (if any) can I remove?
Thanks in advance for your help!

P.S. How can I best provide the right info for anyone to advise me as I may not yet post images?

As requested:

$ dpkg -l | grep linux-image-
rc  linux-image-3.13.0-30-generic                         3.13.0-30.55                                        i386         Linux kernel image for version 3.13.0 on 32 bit x86 SMP
ii  linux-image-3.13.0-46-generic                         3.13.0-46.79                                        i386         Linux kernel image for version 3.13.0 on 32 bit x86 SMP
ii  linux-image-3.13.0-48-generic                         3.13.0-48.80                                        i386         Linux kernel image for version 3.13.0 on 32 bit x86 SMP
ii  linux-image-3.13.0-49-generic                         3.13.0-49.83                                        i386         Linux kernel image for version 3.13.0 on 32 bit x86 SMP
ii  linux-image-3.13.0-51-generic                         3.13.0-51.84                                        i386         Linux kernel image for version 3.13.0 on 32 bit x86 SMP
ii  linux-image-3.13.0-52-generic                         3.13.0-52.86                                        i386         Linux kernel image for version 3.13.0 on 32 bit x86 SMP
ii  linux-image-3.13.0-53-generic                         3.13.0-53.89                                        i386         Linux kernel image for version 3.13.0 on 32 bit x86 SMP
rc  linux-image-extra-3.13.0-30-generic                   3.13.0-30.55                                        i386         Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
ii  linux-image-extra-3.13.0-46-generic                   3.13.0-46.79                                        i386         Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
ii  linux-image-extra-3.13.0-48-generic                   3.13.0-48.80                                        i386         Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
ii  linux-image-extra-3.13.0-49-generic                   3.13.0-49.83                                        i386         Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
ii  linux-image-extra-3.13.0-51-generic                   3.13.0-51.84                                        i386         Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
ii  linux-image-extra-3.13.0-52-generic                   3.13.0-52.86                                        i386         Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
iF  linux-image-extra-3.13.0-53-generic                   3.13.0-53.89                                        i386         Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
iU  linux-image-generic                                   3.13.0.53.60                                        i386         Generic Linux kernel image

So when I run "sudo apt-get autoremove" the response is now:

Reading package lists... Done Building dependency tree
Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

By the way I did manually delete several older linux-image files in /boot.

The output now for "apt-get update and apt-get dist-upgrade "

Fetched 1166 kB in 20s (56,0 kB/s)
Reading package lists... Done

sudo apt-get dist-upgrade Reading package lists... Done Building dependency tree
Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Just to be clear on the current situation:

Device: /dev/sda1 Size: 255 MB — 39 MB free (84,6% full)

Device: /dev/zorin-os-vg/swap_1 Contents: Swap (version 2) — Active Size: 1,6 GB (1602224128 bytes)

uname -r : sudo uname -r 3.13.0-62-generic

dpkg -l | grep linux-image-

rc linux-image-3.13.0-57-generic 3.13.0-57.95
rc linux-image-3.13.0-58-generic 3.13.0-58.97
rc linux-image-3.13.0-59-generic 3.13.0-59.98
rc linux-image-3.13.0-61-generic 3.13.0-61.100 ii linux-image-3.13.0-62-generic 3.13.0-62.102
rc linux-image-extra-3.13.0-57-generic 3.13.0-57.95
rc linux-image-extra-3.13.0-58-generic 3.13.0-58.97 rc linux-image-extra-3.13.0-59-generic 3.13.0-59.98
rc linux-image-extra-3.13.0-61-generic 3.13.0-61.100
ii linux-image-extra-3.13.0-62-generic 3.13.0-62.102
ii linux-image-generic 3.13.0.62.69

Strangely (or not perhaps) I am still getting the message that my /Boot is full.

So to check the status I used: df -Th | sort Result:

/dev/mapper/zorin--os--vg-root ext4 145G 8,9G 129G 7% / /dev/sda1 ext2 236M 235M 0 100% /boot /dev/sdb vfat 967M 233M 735M 25% /media/home/SAN Filesystem Type Size Used Avail Use% Mounted on none tmpfs 100M 24K 100M 1% /run/user none tmpfs 4,0K 0 4,0K 0% /sys/fs/cgroup none tmpfs 5,0M 0 5,0M 0% /run/lock none tmpfs 750M 80K 750M 1% /run/shm tmpfs tmpfs 150M 1,4M 149M 1% /run udev devtmpfs 737M 4,0K 737M 1% /dev

I then searched again for the latest Keernel file:

uname -r 3.13.0-63-generic

Running: ls /usr/src | grep linux-headers seems to show that I have cleaned out all unrequired kernels:

linux-headers-3.13.0-62 linux-headers-3.13.0-62-generic linux-headers-3.13.0-63 linux-headers-3.13.0-63-generic

Strangely if I run: dpkg -l | grep linux-image

I still see all listings such as:

rc linux-image-3.13.0-57-generic 3.13.0-57.95 rc linux-image-3.13.0-58-generic 3.13.0-58.97 rc linux-image-3.13.0-59-generic 3.13.0-59.98

This despite running all kinds of purge commands.

So someone suggested running: sudo apt-get dist-upgrade to clear out everything except the last kernel.

Result:

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

dpkg: error processing package linux-image-generic (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. E: Sub-process /usr/bin/dpkg returned an error code (1)

So it would seem that there are still to many files in my /boot When I check using ls -alhR /boot

I see that several old Kernel files are still there:

-rw-r--r-- 1 root root 1,2M jul 25 01:11 abi-3.13.0-59-generic -rw-r--r-- 1 root root 1,2M jul 29 14:40 abi-3.13.0-61-generic -rw-r--r-- 1 root root 166K jul 25 01:11 config-3.13.0-59-generic -rw-r--r-- 1 root root 166K jul 29 14:40 config-3.13.0-61-generic -rw-r--r-- 1 root root 27M jul 28 02:40 initrd.img-3.13.0-59-generic -rw-r--r-- 1 root root 27M aug 6 03:09 initrd.img-3.13.0-61-generic -rw------- 1 root root 2,6M jul 25 01:11 System.map-3.13.0-59-generic -rw------- 1 root root 2,6M jul 29 14:40 System.map-3.13.0-61-generic -rw------- 1 root root 5,6M jul 25 01:11 vmlinuz-3.13.0-59-generic -rw------- 1 root root 5,6M jul 29 14:40 vmlinuz-3.13.0-61-generic

I just ran: sudo apt-get update and sudo apt-get autoremove

result:

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

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

dpkg: error processing package linux-image-generic (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: linux-image-extra-3.13.0-63-generic linux-image-generic E: Sub-process /usr/bin/dpkg returned an error code (1)

Kept on looking for a solution and fouond this command "script"

dpkg -l 'linux-' | sed '/^ii/!d;/'"$(uname -r | sed "s/(.)-([^0-9]+)/\1/")"'/d;s/^[^ ]* [^ ]* ([^ ])./\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

When running this command it indicates: The following packages will be REMOVED: linux-headers-3.13.0-62* linux-headers-3.13.0-62-generic* linux-image-3.13.0-62-generic* linux-image-extra-3.13.0-62-generic* 0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded. 2 not fully installed or removed. After this operation, 223 MB disk space will be freed.

And it does as those files are nowhere to be found any more. But it also says:

Generating grub configuration file ... Found theme: /boot/grub/themes/Zorin/theme.txt Found linux image: /boot/vmlinuz-3.13.0-63-generic Found initrd image: /boot/initrd.img-3.13.0-63-generic Found linux image: /boot/vmlinuz-3.13.0-61-generic Found initrd image: /boot/initrd.img-3.13.0-61-generic Found linux image: /boot/vmlinuz-3.13.0-59-generic Found initrd image: /boot/initrd.img-3.13.0-59-generic Found memtest86+ image: /memtest86+.elf Found memtest86+ image: /memtest86+.bin done

and here I see the old 3.13.0-59-generic and 3.13.0-61-generic again which are obviously still taking up unnecessary space.

Two questions there for remain....

ONE - How can I adapt "dpkg -l 'linux-' | sed '/^ii/!d;/'"$(uname -r | sed "s/(.)-([^0-9]+)/\1/")"'/d;s/^[^ ]* [^ ]* ([^ ])./\1/;/[0-9]/!d' | xargs sudo apt-get -y purge"

So it also deletes these old kernel files?

TWO - It would seem that best practise is to have at least the two most recent kernels installed on the computer and I just wiped one of those, can I still reinstall "3.13.0-62-generic" and how?

Thanks for your help as always.


thanks to all for helping me.

Not quite sure whether I have decided on the best method, but I now tend just use:

sudo apt-get update; sudo apt-get dist-upgrade; sudo apt-get autoremove

every now and then.

Still, I need to find a way to increase my boot partition size because I somehow doubt whether the above mentioned method will be enough in the future.

Best Regards

Seth
  • 58,122
jansmits
  • 101

2 Answers2

0

I'm assuming you have a seperate /boot partion. This happens over time as you upgrade your kernel. In my experience, if you get an error telling you that you have no space left while running a dist-upgrade you can run:

sudo apt-get autoremove

Then the system will remove the old kernel and install the new one. If you want to remove the kernels you are not using, you can easily use synaptic by searching for linux-headers and linux-image. Synaptic will show you all of the kernels you have, and you can right click on each one and click mark for removal. Just make sure you don't remove all of them. Remove all but the latest (it's good to leave one in case something breaks so you can fall back).

Chev_603
  • 1,676
  • 3
  • 18
  • 30
  • 1
    Autoremove won't install any "new" kernel. Linux-headers are not kernels. – Pilot6 May 22 '15 at 21:54
  • Actaully I may be mistaken. I believe you have to run apt-get update and apt-get dist-upgrade again after running autoremove. That seemed to solve the problem for me. – Chev_603 May 22 '15 at 22:00
0

Begin to execute this command to check which version you are running:

uname -r

Then check linux headers and image currently installed :

dpkg -l | grep -Ei "linux-headers|linux-image"

Finally purge old version (here 3.13.0-30):

sudo apt-get remove linux-headers-3.13.0-30 linux-headers-3.13.0-30-generic linux-image-3.13.0-30-generic linux-image-extra-3.13.0-30-generic --purge

NOTE : Be carefull, do not purge the current version you are running. Also, try to keep one or two older version just in case.

Inglebard
  • 195