Switching from OVH kernel to default kernel without reinstalling Ubuntu

I have a dedicated server hosted by OVH.

When installing the server I must have left the default choice of kernel which is to use the stable/tested OVH kernel rather than the distribution’s native kernel.

I have recently switched to using APF firewall rather than UFW and after setting up APF with all my rules and starting it with apf -s I get an output that looks like this:

apf(11291): {glob} flushing & zeroing chain policies apf(11291):
{glob} firewall offline apf(11328): {glob} activating firewall
libkmod: ERROR ../libkmod/libkmod-module.c:1655
kmod_module_new_from_loaded: could not open /proc/modules: No such
file or directory Error: could not get list of modules: No such file
or directory apf(11368): {glob} kernel version not equal to 2.4.x or
2.6.x, aborting. apf(11328): {glob} firewall initalized

I changed a setting in APF called MONOKERN which is described as “Support Monolithic kernel builds [no LKM’s]” after finding a forum post explaining that this is needed due to the kernel some hosts use.

Restarting APF with apf -r then produced this output:

apf(22524): {glob} flushing & zeroing chain policies apf(22524):
{glob} firewall offline apf(22599): {glob} activating firewall
libkmod: ERROR ../libkmod/libkmod-module.c:1655
kmod_module_new_from_loaded: could not open /proc/modules: No such
file or directory Error: could not get list of modules: No such file
or directory apf(22703): {glob} determined (IFACE_UNTRUSTED) eth0 has
address 158.69.123.46 apf(22703): {glob} loading preroute.rules
//carries on printing out the firewall rules it is setting up...
apf(22599): {glob} firewall initalized

OVH have said that I can always change the kernel during a re-installation, but I really don’t want to do that.

I host a somewhat popular game on my server with around 100 users online at any given time. To take the server offline for a few hours to reinstall the distribution and set everything up again really isn’t practical.

Is it possible to switch back to the native distribution kernel for Ubuntu 16.04 without performing a reinstallation and losing all my configurations/data and installed packages, and if so how?

Answer

You can install a new kernel with apt-get install as usual, and then it should show a menu where you can select the kernel you want to use.

If that does not happen, you can look at the question https://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader/52990 for further information on editing GRUB settings for booting a particular kernel.

Attribution
Source : Link , Question Author : James , Answer Author : Community

Leave a Comment