# Installing Mainline kernels under Ubuntu



## johnspack (Apr 20, 2022)

You would think it would be simple right?  Nope.  To install initially it is pretty simple..  I just use the mainline ppa,  which you can add using:
sudo add-apt-repository ppa:cappelikan/ppa
sudo apt update
sudo apt install mainline

Then it will show up in System in your menu and you can run it.
You can run it and install newest kernel 5.17.3...  however you will have issues when you try to boot it.
No video driver.  Either after this,  or before,  you must make sure you have the nvidia dkms module loaded,
or it can't compile the driver for the new kernel.  At this point you should have driver series 510 installed.
So then,  do a :  sudo apt install nvidia-driver-510 nvidia-dkms-510
Reboot,  and you should be able to boot the new kernel with no issues.
Fought with this for a few days until I figured it out....  And please,  beginners to linux...  do not try this!  Only for experienced users.


----------



## Ja.KooLit (Jul 12, 2022)

Just one thing I dont like about ubuntu is the PPA. While its true that there have been no malicious codes (known) added in personal PPA's, its still kinda risky


----------

