I m running Ubuntu 16.04. After a prompt by software update, that I discarded, as I booted I opened a terminal and run my update alias:
alias maintain='set -x; sudo apt-get update && sudo apt-get upgrade && sudo apt autoremove && sudo apt autoclean; set +x'
Weirdly no package got upgraded but i did get the following message:
The following packages have been kept back:
There were 3 packages with names linux,image,headers don't remember the exact names.
After checking here I run
sudo apt-get install [3 packages names here]
and the packages installed without errors or warnings. Thinking that the kernel can't be completely updated while running I also rebooted my laptop. Wanting to check if the update was completed I run the following commands [that I found here while checking for the previous warning] on my terminal:
$ uname -r
4.4.0-21-generic
$ dpkg -l | grep linux-image
ii linux-image-4.4.0-21-generic 4.4.0-21.37 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-22-generic 4.4.0-22.40 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-24-generic 4.4.0-24.43 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-21-generic 4.4.0-21.37 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-22-generic 4.4.0-22.40 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-24-generic 4.4.0-24.43 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-generic 4.4.0.24.25 amd64 Generic Linux kernel image
Apart from the fact that I have three instead of 2 images from the kernel the question is:
Why do I have multiple images of the kernel installed? Since my alias runs autoremove/autoclean [and I rebooted once more and rerun the alias to err on the safe side] shouldn't they be deleted? Also shouldn't, after reboot, Ubuntu be using the latest kernel version?
update1: ls /boot results:
$ ls /boot
abi-4.4.0-21-generic config-4.4.0-22-generic initrd.img-4.4.0-22-generic memtest86+_multiboot.bin vmlinuz-4.4.0-21-generic
abi-4.4.0-22-generic config-4.4.0-24-generic initrd.img-4.4.0-24-generic System.map-4.4.0-21-generic vmlinuz-4.4.0-22-generic
abi-4.4.0-24-generic grub memtest86+.bin System.map-4.4.0-22-generic vmlinuz-4.4.0-24-generic
config-4.4.0-21-generic initrd.img-4.4.0-21-generic memtest86+.elf System.map-4.4.0-24-generic
update2: After running sudo update-grub
and rebooting I still get:
$ uname -r
4.4.0-21-generic
I also remember seeing the grub being updated from terminal output when the new kernel packages were being installed.
update3: I tried booting into kernel 4.4.0-24 from grub2 advanced boot options and then running sudo update-grub
again. But after another reboot uname -r
still shows 4.4.0-21 :(
update4: I am thinking of other angles to approach the problem. I considered manually setting grub to load on the new kernel but that is a workaround not a fix since I d need to do it again every time I download a new kernel. During this I remembered that I have used grub-customizer to do some minor tweaks (because I m dual booting with win7). I am pasting the relevant entries from /boot/grub/grub.cfg if people can spot what's wrong and how it could be fixed. It's the menu entry from ubuntu and 2 (out of 9) submenu entries from advanced boot options:
# # BEGIN /etc/grub.d/40_custom_proxy ###
menuentry "Ubuntu 16" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-4e2b96c0-04a0-4750-bd14-479f684bf3be' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 4e2b96c0-04a0-4750-bd14-479f684bf3be
else
search --no-floppy --fs-uuid --set=root 4e2b96c0-04a0-4750-bd14-479f684bf3be
fi
linux /boot/vmlinuz-4.4.0-21-generic root=UUID=4e2b96c0-04a0-4750-bd14-479f684bf3be ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.4.0-21-generic
}
# ## END /etc/grub.d/40_custom_proxy ###
menuentry "Ubuntu, with Linux 4.4.0-21-generic" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-21-generic-advanced-4e2b96c0-04a0-4750-bd14-479f684bf3be' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 4e2b96c0-04a0-4750-bd14-479f684bf3be
else
search --no-floppy --fs-uuid --set=root 4e2b96c0-04a0-4750-bd14-479f684bf3be
fi
echo 'Loading Linux 4.4.0-21-generic ...'
linux /boot/vmlinuz-4.4.0-21-generic root=UUID=4e2b96c0-04a0-4750-bd14-479f684bf3be ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-21-generic
}
menuentry "Ubuntu, with Linux 4.4.0-24-generic" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-24-generic-advanced-4e2b96c0-04a0-4750-bd14-479f684bf3be' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 4e2b96c0-04a0-4750-bd14-479f684bf3be
else
search --no-floppy --fs-uuid --set=root 4e2b96c0-04a0-4750-bd14-479f684bf3be
fi
echo 'Loading Linux 4.4.0-24-generic ...'
linux /boot/vmlinuz-4.4.0-24-generic root=UUID=4e2b96c0-04a0-4750-bd14-479f684bf3be ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-24-generic
}
I 'm not sure how relevant that is - and that file is supposed to not be changed. But I m guessing that whatever the problem is it can create a footprint in that file to be identified. (Hopefully.)
apt
should update grub when installing the new kernel, but just to be sure, runsudo update-grub
and reboot again anduname -r
– Zanna Jun 11 '16 at 19:03mount | grep /boot
. – Kalle Richter Jun 11 '16 at 19:24