I got it! It was an error in my code actually ???
We were looking at 4.11.0
OR 4.12.0 when we should be doing
AND instead of OR. I have improved the code by simply comparing to an array of options instead:
Code:
...
if [[ "$KERNLIST" =~ ^(4.11.0|4.12.0)$ ]]; then
...
The INSTALL result below: :P
Code:
liteuser@LiteBox:~$ tail -f /tmp/ltlogs.log
The following NEW packages will be installed:
linux-firmware-image-linuxlite-4.11.0 linux-headers-linuxlite-4.11.0
linux-image-linuxlite-4.11.0
0 upgraded, 3 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/80.5 MB of archives.
After this operation, 295 MB of additional disk space will be used.
Selecting previously unselected package linux-firmware-image-linuxlite-4.11.0.
(Reading database ... 234354 files and directories currently installed.)
Preparing to unpack .../linux-firmware-image-linuxlite-4.11.0_0010_amd64.deb ...
Unpacking linux-firmware-image-linuxlite-4.11.0 (0010) ...
Selecting previously unselected package linux-headers-linuxlite-4.11.0.
Preparing to unpack .../linux-headers-linuxlite-4.11.0_0010_amd64.deb ...
Unpacking linux-headers-linuxlite-4.11.0 (0010) ...
Selecting previously unselected package linux-image-linuxlite-4.11.0.
Preparing to unpack .../linux-image-linuxlite-4.11.0_0010_amd64.deb ...
Unpacking linux-image-linuxlite-4.11.0 (0010) ...
Setting up linux-firmware-image-linuxlite-4.11.0 (0010) ...
Setting up linux-headers-linuxlite-4.11.0 (0010) ...
Setting up linux-image-linuxlite-4.11.0 (0010) ...
update-initramfs: Generating /boot/initrd.img-4.11.0
Generating grub configuration file ...
Found background: /boot/grub_linux_lite.png
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found background image: /boot/grub_linux_lite.png
Found linux image: /boot/vmlinuz-4.11.0
Found initrd image: /boot/initrd.img-4.11.0
Found linux image: /boot/vmlinuz-4.7.0-linuxlite
Found initrd image: /boot/initrd.img-4.7.0-linuxlite
Found linux image: /boot/vmlinuz-4.4.0-77-generic
Found initrd image: /boot/initrd.img-4.4.0-77-generic
Found linux image: /boot/vmlinuz-4.4.0-75-generic
Found initrd image: /boot/initrd.img-4.4.0-75-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
The REMOVAL result below ( Yeah, I have updated Kernel Removal also ) :)
Code:
tail -f /tmp/ltlogs.log
Removing kernels: linux-firmware-image-linuxlite-4.11.0 linux-headers-linuxlite-4.11.0 linux-image-linuxlite-4.11.0
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
libappindicator1 libgtksourceview2.0-0 libgtksourceview2.0-common
python-appindicator python-enchant python-gtksourceview2
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
linux-firmware-image-linuxlite-4.11.0* linux-headers-linuxlite-4.11.0*
linux-image-linuxlite-4.11.0*
0 upgraded, 0 newly installed, 3 to remove and 4 not upgraded.
After this operation, 295 MB disk space will be freed.
(Reading database ... 266143 files and directories currently installed.)
Removing linux-firmware-image-linuxlite-4.11.0 (0010) ...
Removing linux-headers-linuxlite-4.11.0 (0010) ...
Removing linux-image-linuxlite-4.11.0 (0010) ...
dkms: removing: virtualbox-guest 5.0.36 (4.11.0) (x86_64)
-------- Uninstall Beginning --------
Module: virtualbox-guest
Version: 5.0.36
Kernel: 4.11.0 (x86_64)
-------------------------------------
Status: Before uninstall, this module version was ACTIVE on this kernel.
vboxguest.ko:
- Uninstallation
- Deleting from: /lib/modules/4.11.0/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
vboxsf.ko:
- Uninstallation
- Deleting from: /lib/modules/4.11.0/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
vboxvideo.ko:
- Uninstallation
- Deleting from: /lib/modules/4.11.0/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod.....
DKMS: uninstall completed.
update-initramfs: Deleting /boot/initrd.img-4.11.0
Generating grub configuration file ...
Found background: /boot/grub_linux_lite.png
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found background image: /boot/grub_linux_lite.png
Found linux image: /boot/vmlinuz-4.7.0-linuxlite
Found initrd image: /boot/initrd.img-4.7.0-linuxlite
Found linux image: /boot/vmlinuz-4.4.0-77-generic
Found initrd image: /boot/initrd.img-4.4.0-77-generic
Found linux image: /boot/vmlinuz-4.4.0-75-generic
Found initrd image: /boot/initrd.img-4.4.0-75-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
Purging configuration files for linux-image-linuxlite-4.11.0 (0010) ...
https://unlockforus.com
Sorry for seeming stupid and preferring Linux - I just don't know any better.