0

EDIT: This is not a duplicate as the other questions reference removing old kernel versions, however I only have newer kernel versions that I can remove. I want to understand (a) if there will be problems removing newer kernel versions and (b) how come the system isn't using the latest installed kernel version.

EDIT 2: I am not asking how to remove kernels, I am asking what the consequence (if any) of removing newer kernels is.

I am running Ubuntu 16 and I just tried to apt-get upgrade but hit some problems due to /boot being 100% full.

I have read a number of posts about how to purge kernels, but of all the kernels in /boot, I am apparently using the oldest one!

Do I purge some of the newer kernels? Will this cause other problems? I understand I may need to truncate some of the files to create space in order to purge.

How come the system isn't using the latest kernel? Have I done something wrong in the past when apt-get upgrading?

Here is what I have:

www-server:/boot# ls -l
total 465165
-rw-r--r-- 1 root root  1239577 Apr 18  2017 abi-4.4.0-21-generic
-rw-r--r-- 1 root root  1245659 Feb 23  2017 abi-4.4.0-65-generic
-rw-r--r-- 1 root root  1245512 Mar  3  2017 abi-4.4.0-66-generic
-rw-r--r-- 1 root root  1245659 Mar 22  2017 abi-4.4.0-70-generic
-rw-r--r-- 1 root root  1245659 Mar 24  2017 abi-4.4.0-71-generic
-rw-r--r-- 1 root root  1245659 Mar 31  2017 abi-4.4.0-72-generic
-rw-r--r-- 1 root root  1246246 Apr 20 13:02 abi-4.4.0-75-generic
-rw-r--r-- 1 root root  1246312 Apr 27 19:24 abi-4.4.0-78-generic
-rw-r--r-- 1 root root  1246311 May 17 23:09 abi-4.4.0-79-generic
-rw-r--r-- 1 root root  1246311 Jun 14 13:24 abi-4.4.0-81-generic
-rw-r--r-- 1 root root  1246511 Jun 26 20:45 abi-4.4.0-83-generic
-rw-r--r-- 1 root root  1246670 Jul 18 16:00 abi-4.4.0-87-generic
-rw-r--r-- 1 root root   189412 Apr 18  2017 config-4.4.0-21-generic
-rw-r--r-- 1 root root   190236 Feb 23  2017 config-4.4.0-65-generic
-rw-r--r-- 1 root root   190247 Mar  3  2017 config-4.4.0-66-generic
-rw-r--r-- 1 root root   190236 Mar 22  2017 config-4.4.0-70-generic
-rw-r--r-- 1 root root   190236 Mar 24  2017 config-4.4.0-71-generic
-rw-r--r-- 1 root root   190236 Mar 31  2017 config-4.4.0-72-generic
-rw-r--r-- 1 root root   190214 Apr 20 13:02 config-4.4.0-75-generic
-rw-r--r-- 1 root root   190355 Apr 27 19:24 config-4.4.0-78-generic
-rw-r--r-- 1 root root   190356 May 17 23:09 config-4.4.0-79-generic
-rw-r--r-- 1 root root   190356 Jun 14 13:24 config-4.4.0-81-generic
-rw-r--r-- 1 root root   190356 Jun 26 20:45 config-4.4.0-83-generic
-rw-r--r-- 1 root root   190356 Jul 18 16:00 config-4.4.0-87-generic
drwxr-xr-x 5 root root     1024 Jun  7 12:18 grub
-rw-r--r-- 1 root root 35701907 Apr 18  2017 initrd.img-4.4.0-21-generic
-rw-r--r-- 1 root root 36237310 Mar  2  2017 initrd.img-4.4.0-65-generic
-rw-r--r-- 1 root root 36226866 Mar  8  2017 initrd.img-4.4.0-66-generic
-rw-r--r-- 1 root root 36238987 Mar 28  2017 initrd.img-4.4.0-70-generic
-rw-r--r-- 1 root root 36239208 Mar 30  2017 initrd.img-4.4.0-71-generic
-rw-r--r-- 1 root root 36238449 Apr  5  2017 initrd.img-4.4.0-72-generic
-rw-r--r-- 1 root root 36239920 Apr 25 06:55 initrd.img-4.4.0-75-generic
-rw-r--r-- 1 root root 36236616 May 17 16:49 initrd.img-4.4.0-78-generic
-rw-r--r-- 1 root root 36235856 Jun  7 12:18 initrd.img-4.4.0-79-generic
drwx------ 2 root root    12288 Apr 28  2016 lost+found
-rw------- 1 root root  3853719 Apr 18  2017 System.map-4.4.0-21-generic
-rw------- 1 root root  3882407 Feb 23  2017 System.map-4.4.0-65-generic
-rw------- 1 root root  3883990 Mar  3  2017 System.map-4.4.0-66-generic
-rw------- 1 root root  3882277 Mar 22  2017 System.map-4.4.0-70-generic
-rw------- 1 root root  3882277 Mar 24  2017 System.map-4.4.0-71-generic
-rw------- 1 root root  3882277 Mar 31  2017 System.map-4.4.0-72-generic
-rw------- 1 root root  3883390 Apr 20 13:02 System.map-4.4.0-75-generic
-rw------- 1 root root  3882872 Apr 27 19:24 System.map-4.4.0-78-generic
-rw------- 1 root root  3883279 May 17 23:09 System.map-4.4.0-79-generic
-rw------- 1 root root  3883391 Jun 14 13:24 System.map-4.4.0-81-generic
-rw------- 1 root root  3883887 Jun 26 20:45 System.map-4.4.0-83-generic
-rw------- 1 root root  3884173 Jul 18 16:00 System.map-4.4.0-87-generic
-rw------- 1 root root  7013968 Apr 18  2017 vmlinuz-4.4.0-21-generic
-rw------- 1 root root  7082608 Feb 23  2017 vmlinuz-4.4.0-65-generic
-rw------- 1 root root  7087024 Mar  3  2017 vmlinuz-4.4.0-66-generic
-rw------- 1 root root  7083344 Mar 22  2017 vmlinuz-4.4.0-70-generic
-rw------- 1 root root  7083344 Mar 24  2017 vmlinuz-4.4.0-71-generic
-rw------- 1 root root  7083248 Mar 31  2017 vmlinuz-4.4.0-72-generic
-rw------- 1 root root  7081872 Apr 20 13:02 vmlinuz-4.4.0-75-generic
-rw------- 1 root root  7089552 Apr 27 19:24 vmlinuz-4.4.0-78-generic
-rw------- 1 root root  7091696 May 17 23:09 vmlinuz-4.4.0-79-generic
-rw------- 1 root root  7092784 Jun 14 13:24 vmlinuz-4.4.0-81-generic
-rw------- 1 root root  7092720 Jun 26 20:45 vmlinuz-4.4.0-83-generic
-rw------- 1 root root  7095888 Jul 18 16:00 vmlinuz-4.4.0-87-generic
www-server:/boot# uname -r
4.4.0-21-generic
  • Can you interrupt the boot process at the GRUB menu and select 4.4.0-87? – chili555 Oct 09 '17 at 15:48
  • It is a live installation on a hosted server that I don't have console access to :( – Ben Holness Oct 09 '17 at 15:50
  • 2
  • @Phillip-ZyanKLee-Stockmann - I don't think it's a duplicate - the referenced post (and others I looked at) are about moving OLD kernel versions. I am wondering about when my kernel is currently the oldest version and all I could remove is newer versions. – Ben Holness Oct 09 '17 at 16:04
  • @BenHolness -- you remove them the same way, you can remove all kernels, except the one currently in use --- well you could remove the one in use also but that will break the system. – ravery Oct 09 '17 at 16:12
  • anyway ... why do you want to use older kernels and remove new ones instead of old ones? When was the last time the server was rebooted? Usually after a reboot it should use the newest kernel... – derHugo Oct 09 '17 at 18:34
  • It was last rebooted about a year and a half ago. I don't want to use older kernels, I was just asked to make an update and in doing so I noticed that it had been a while since anyone did an apt-get upgrade and then I hit this problem. I am concerned that rebooting will be problematic, don't have access to console and my searches haven't found anything about how to resolve it in this situation (there are only newer kernels that I can remove), so I am researching as much as I can before continuing. – Ben Holness Oct 09 '17 at 18:38
  • Judging from the missing initram disks, 79 or maybe 78 will be the latest kernel that looks complete and bootable. – ubfan1 Oct 09 '17 at 21:46
  • @ubfan1 - Without console access, is there a way to force the system to boot to 78 or 79 on the next reboot? I am worried about what will happen the next time I reboot! – Ben Holness Oct 09 '17 at 21:49
  • The file /boot/grub/grub.cfg controls what boots. You can edit the file and put the 79 kernel in first place. I'd clean up the intermediate kernels first, the ones you know you wont use like 65-75 (assuming you are running 21) and get the latest kernels installed. That should leave you with an updated grub.cfg file booting the latest kernel. – ubfan1 Oct 09 '17 at 23:02
  • @ubfan1 - thanks! Should I also remove the incomplete ones after 79, or let the system deal with that by itself after booting to 79? – Ben Holness Oct 09 '17 at 23:17
  • When you have enough free space, the incomplete kernels will try to install I think. Then reboot again to get the latest one. If not enough room, (some but not all get installed), repeat on the unused kernels, saving the latest complete one and the booting one. – ubfan1 Oct 10 '17 at 02:42

0 Answers0