Jarno, I did notice that those commands were in the original script after I posted that.
I got the 4.3.0-6-generic installed in Xubuntu 16.04 just a while ago and your script worked flawlessly.
I had 3 kernels: 4.3.0-2-generic, 4.3.0-5-generic and 4.3.0-6-generic after installation and the 01autoremove-kernels file contained just the last 2 both before and after rebooting. The output is attached
Jarno, I did notice that those commands were in the original script after I posted that. kernels file contained just the last 2 both before and after rebooting. The output is attached
I got the 4.3.0-6-generic installed in Xubuntu 16.04 just a while ago and your script worked flawlessly.
I had 3 kernels: 4.3.0-2-generic, 4.3.0-5-generic and 4.3.0-6-generic after installation and the 01autoremove-