You can also do it the easy way, instead of installing Ubuntu, which is based on Debian, install and Arch spin such as Arco Linux https://arcolinux.com/ and during the installation choose the 'hardened kernel' option instead of the default or zen kernel.