40

I see the following error while trying run the command shown below. I read somewhere that my /boot partition is low on disk space. How can I increase the size of the /boot partition so I can install more software? I have a 500GB hard disk, so there is enough space to play with.

sudo apt-get install libdvdread4

gzip: stdout: No space left on device                                                                                                                                                                              
   E: mkinitramfs failure cpio 141 gzip 1                                                                                                                                                                             
   update-initramfs: failed for /boot/initrd.img-3.2.0-33-generic with 1.                                                                                                                                             
   run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1                                                                                                                                        
   Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-33-generic.postinst line 1010.                                                                                                    
   dpkg: error processing linux-image-3.2.0-33-generic (--configure):                                                                                                                                                 
    subprocess installed post-installation script returned error exit status 2                                                                                                                                        
   dpkg: dependency problems prevent configuration of linux-image-server:                                                                                                                                             
   linux-image-server depends on linux-image-3.2.0-33-generic; however:                                                                                                                                              
     Package linux-image-3.2.0-33-generic is not configured yet.
   dpkg: error processing linux-image-server (--configure):
    dependency problems - leaving unconfigured
   dpkg: dependency problems prevent configuration of linux-server:
    linux-server depends on linux-image-server (= 3.2.0.33.36); however:
     Package linux-image-server is not configured yet.
   dpkg: error processing linux-server (--configure):
    dependency problems - leaving unconfigured
   No 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.
 Errors were encountered while processing:
 linux-image-3.2.0-33-generic
 linux-image-server
 linux-server
N: Ignoring file 'michael-gruz-canon-precise.list.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'michael-gruz-canon-precise.list.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension

Listed below is the output of du

Filesystem              1K-blocks      Used Available Use% Mounted on
/dev/mapper/ubuntu-root 712660664 104095912 572363692  16% /
udev                      3964792         4   3964788   1% /dev
tmpfs                     1591012      1064   1589948   1% /run
none                         5120         0      5120   0% /run/lock
none                      3977528       684   3976844   1% /run/shm
/dev/sda1                  233191    219821       929 100% /boot
2
  • One note - you're talking about disk space, not memory here ;) Nov 29, 2012 at 1:59
  • I've also changed the tag and improved the wording a bit so that it's more easily found by other users. Please approve if you're ok with it. Nov 29, 2012 at 2:04

2 Answers 2

74

You have a separate partition for /boot that is only around 227MB in size. This partition is full.

The reason Ubuntu has given you a separate parition for /boot seems to be that you are using LVM and/or "full" disk encryption on the rest of the drive.

The /boot directory contains all of your kernel images, so the likely cause of this issue is that you have too many previous kernels installed. Ubuntu issues kernel updates which bump the version number in the package name fairly frequently even for long term stable versions, so over time if you keep the system up to date, the /boot directory will grow.

You should be able to list your installed kernels with

aptitude search ~ilinux-image

(Note that this will probably return packages that aren't kernels, too).

There is usually no need for more than two kernels to be installed - the one currently in use and the previous known working kernel (as a fallback). So you can start removing the older ones, one by one, like this:

sudo apt-get autoremove linux-image-3.2.0-23-generic

Make sure you substitute "3.2.0-23-generic" with the actual kernel version you want to remove! Also, don't remove packages such as linux-image-generic. You have to be really careful not to remove the currently running kernel or you won't be able to boot (Ubuntu may or may not warn you about doing this).

You can find your currently running kernel with:

uname -r

Here's an illustrated guide to doing what I've just explained. This article uses slightly different tools but basically the same approach.

7
  • 3
    To list the installed kernels on Ubintu 16.04: ------ apt list --installed | sed -rn 's|^(linux-image-[0-9].*-generic)|\1 |p' ------- The above "aptitude search ..." didn't work properly. Very helpful answer, thanks. Apr 25, 2018 at 23:11
  • Alternative list of kernels: dpkg --list | grep linux-image
    – TomDLT
    May 30, 2019 at 16:43
  • Your link redirects to home page. Please provide the current link.
    – Animesh D
    Aug 18, 2020 at 18:01
  • Archive.org link added but given the age of the article it may be out of date. The instructions I have in the answer should be enough; the article basically just went through that process. Aug 19, 2020 at 23:46
  • If aptitude is not installed, sudo apt install aptitude may also fail given this scenario (out of space on /boot). Using apt list --installed | grep "inux-image" as Craig Hicks mentioned enabled me to see a list of kernels suffixed with [installed,auto-removable], which I was then able to remove per the rest of the answer.
    – cod3monk3y
    Sep 7, 2023 at 22:36
0

I actually wanted to comment to neon_overload, but the askubuntu prevents me from doing it..

I followed the process but now the package: linux-image-generic does not appear after I run: aptitude search ~ilinux-image

and now I don't know how to continue - I'm running on 3.14 kenel:

$ uname -a
Linux ***** 3.13.1-031301-generic #201401291035 SMP Wed Jan 29 15:37:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Now I do not know if I need to install the linux-image-generic that I can find in synaptic package manager - 3.2 or install look for the linux-image-generic with the 3.13 version

I have solved the problem by -

  1. installing using synaptic package manager: linux-image-generic and linux-image
  2. followed the regular procedure to install a new kernel - used dpkg -i on the 3 files:

    ubuntu-pc:~/Downloads/kernel_3.13.1$ ls linux-headers-3.13.1-031301_3.13.1-031301.201401291035_all.deb linux-headers-3.13.1-031301-generic_3.13.1-031301.201401291035_amd64.deb
    linux-image-3.13.1-031301-generic_3.13.1-031301.201401291035_amd64.deb

Now I have the linux-image-generic and linux-image in my output of: aptitude search ~ilinux-image.

Now let's try to boot with fingers crossed.

1
  • If you have linux-image-generic installed it will always depend on the current most updated kernel. Always install packages from APT / synaptic, never directly install the .deb with dpkg. You should have asked this as a new question, then you would get more attention. Jun 26, 2014 at 11:43

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