I want to remove the buggy package linux-image-4.9.0-14-amd64 version: 4.9.240-1 so that the server can be booted safely. Can anyone help me and tell me how to remove a kernel which is about to be installed?
When I sudo apt-get purge linux-image-4.9.0-14-amd64 I get:
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
linux-image-4.9.0-11-amd64 linux-image-4.9.0-12-amd64
linux-image-4.9.0-8-amd64
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
linux-image-4.9.0-14-amd64* linux-image-amd64*
0 upgraded, 0 newly installed, 2 to remove and 3 not upgraded.
After this operation, 194 MB disk space will be freed.
Do you want to continue? [Y/n] Abort.
…and I lose my nerve doing this on a production system.
Can anyone verify if I am on the right track or offer a safer / surer way forward. Keep in mind that AWS Lightsail is a limited access environment with none of the tools available to normal AWS instances, so we will have only one shot at getting this right.
Yes, purging installed linux image removes all mentions of it and regenerates grub configuration. I assume, it’s safe to do, especially in your situation and especially if you need to reboot.