1

Just before I dive into describing my issue, I just want to put out that I am quite new with Linux, so keep that in mind if I have not pointed out the obvious.

I have run into some issues with my Ubuntu server. Initially, I found that it was rebooting in a continuous loop. After forcing a power shutdown, and then removing the power cable, reconnecting and performed another boot, I was able to successfully boot the server. After some digging around, I believe the culprit to my server issues is that my boot partition is full.

Output of uname -r

3.16.0-41-generic

Output of cat /etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/NUCmedia--vg-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sdb1 during installation
UUID=b81a82f4-5f78-4f1e-9aaf-711ce2eb08e8 /boot           ext2    defaults        0       2
/dev/mapper/NUCmedia--vg-swap_1 none            swap    sw              0       0
/dev/NUCmedia-vg/NUCstorage     /mnt/NUCStorage ext4    defaults        0       0

Output of df -h:

Filesystem                           Size  Used Avail Use% Mounted on
/dev/mapper/NUCmedia--vg-root         29G  8.2G   20G  30% /
none                                 4.0K     0  4.0K   0% /sys/fs/cgroup
udev                                 3.9G  8.0K  3.9G   1% /dev
tmpfs                                788M  1.9M  786M   1% /run
none                                 5.0M     0  5.0M   0% /run/lock
none                                 3.9G   88K  3.9G   1% /run/shm
none                                 100M   16K  100M   1% /run/user
/dev/sda1                            236M  233M     0 100% /boot
/dev/mapper/NUCmedia--vg-NUCstorage  422G  206G  195G  52% /mnt/NUCStorage

Output of dpkg -l | grep linux-image

ii  linux-image-3.16.0-33-generic                               3.16.0-33.44~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-34-generic                               3.16.0-34.47~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-36-generic                               3.16.0-36.48~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-37-generic                               3.16.0-37.51~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-38-generic                               3.16.0-38.52~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-39-generic                               3.16.0-39.53~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
iF  linux-image-3.16.0-41-generic                               3.16.0-41.57~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
iF  linux-image-3.16.0-43-generic                               3.16.0-43.58~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-33-generic                         3.16.0-33.44~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-34-generic                         3.16.0-34.47~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-36-generic                         3.16.0-36.48~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-37-generic                         3.16.0-37.51~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-38-generic                         3.16.0-38.52~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-39-generic                         3.16.0-39.53~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-extra-3.16.0-41-generic                         3.16.0-41.57~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-extra-3.16.0-43-generic                         3.16.0-43.58~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-extra-3.16.0-44-generic                         3.16.0-44.59~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-extra-3.16.0-51-generic                         3.16.0-51.69~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-generic-lts-utopic                              3.16.0.51.42                                        amd64        Generic Linux kernel image

Output if I try to run the following sudo apt-get remove linux-image-3.16.0-33-generic

no talloc stackframe at ../source3/param/loadparm.c:4864, leaking memory
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-image-extra-3.16.0-33-generic : Depends: linux-image-3.16.0-33-generic but it is not going to be installed
 linux-image-extra-3.16.0-44-generic : Depends: linux-image-3.16.0-44-generic but it is not going to be installed
 linux-image-extra-3.16.0-51-generic : Depends: linux-image-3.16.0-51-generic but it is not going to be installed
 linux-image-generic-lts-utopic : Depends: linux-image-3.16.0-51-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I seem to get similar outputs when trying to remove kernels 34, 36, etc.

I've done a lot of Googling but haven't come up with a solution. There is the one report to try 'apt-get -f install' with no packages but unsure how to do that or if I should even try.

Any help or pointers on how to fix this would be most appreciated!

Thanks,

Torbuck

Pilot6
  • 90,100
  • 91
  • 213
  • 324
torbuck
  • 11
  • 3
  • You can use this answer http://askubuntu.com/questions/263363/how-can-i-remove-old-kernels-install-new-ones-when-boot-is-full, just be sure to use the exact kernel name, using * is a little dangerous, after you delete some of them and get some space on /boot, use apt-get to fix and get your system up-to-date – bistoco Oct 21 '15 at 23:11
  • you could just cd /boot/ do ls then sudo rm linux images. The idea for all these tools, dpkg, apt, aptitude, whatever, is that they make your life easier. Until they simply fail to work. It sounds like you can identify the kernels you want to remove. If that is the case, don’t be afraid to do it manually. sudo apt-get -f install is just a command that trys to fix apt-get when it has broken dependencies. – j0h Oct 22 '15 at 01:08

2 Answers2

1

Use sudo dpkg -r <pkgname> to remove each of the older kernel packages, and then once you free up some space by doing that, sudo apt-get install -f.

psusi
  • 37,551
  • so would I do sudo dpkg -r linux-image-3.16.0-33-generic and then the same for 34,36 37, 38 and 39? – torbuck Oct 22 '15 at 00:02
  • @torbuck, yep.. in fact, iirc, you can do sudo dpkg -r linux-image-3.16.0-{{33,34,35,36,37}}-generic and get them all at once. – psusi Oct 22 '15 at 00:10
  • I seem to be having dependency issues with removing these old kernal packages: `dpkg: dependency problems prevent removal of linux-image-3.16.0-33-generic: linux-image-extra-3.16.0-33-generic depends on linux-image-3.16.0-33-generic.

    dpkg: error processing package linux-image-3.16.0-33-generic (--remove): dependency problems - not removing Errors were encountered while processing: linux-image-3.16.0-33-generic`

    – torbuck Oct 22 '15 at 00:19
  • @torbuck, ahh, you will just have to remove those as well. – psusi Oct 22 '15 at 00:58
0

I ended up just moving initrd.img-3.16.0-33-generic (plus 34, 36, 37 & 38) to a temp folder and then was able to successfully perform a sudo apt-get install -f. Once that was complete, I performed a sudo apt-get autoremove which successfully freed up some space on my boot partition. All is good now!

torbuck
  • 11
  • 3
  • Don't forget to accept your own answer - that's perfectly acceptable. Just click the box to accept the answer and you should be good to go and others will know that this was answered and what worked for you. (It keeps it out of the queue too.) – KGIII Oct 22 '15 at 05:19