# How to Change the kernel in Ubuntu Linux (Downgrade or upgrade) using command line. ## The pics are copied from Internet just for the reference. ## Link: https://itsfoss.com/upgrade-linux-kernel-ubuntu/ ###### tags: `Linux` `Kernel` `OS` Sohail Anjum Last update: 2021.09.30 ### Step 1 : Check current installed version ```javascript= # uname -r or uname -sr ``` ![](https://i.imgur.com/5IyVZhG.png) ### Step 2: Download the mainline Linux kernel of your choice Link: https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D > You can see kernel list like this. I am going to download kernel 5.7. You also should keep in mind to install the stable kernel instead of rc (release candidate). > ![](https://i.imgur.com/3cxPhjj.png) > Now download appropriate kernel files for your architecture. For 64 bit architecture, you should download these kind of files > > linux-headers-VERSION-NUMBER_all.deb > linux-headers-VERSION-NUMBER_amd64.deb > linux-image-VERSION-NUMBER_amd64.deb > linux-modules-VERSION-NUMBER_amd64.deb > Hence I will download these files: ![](https://i.imgur.com/cGfaunC.png) ### Step 3: Install the downloaded kernel > Now it’s time to install downloaded kernel. First do into the directory where you’ve downloaded kernel and enter following command. Make sure there isn’t any other “.deb” file in that directory other than downloaded kernel files. ![](https://i.imgur.com/QMaAuMw.png) > It will take some time. After installation finished, you will see screen like this. ![](https://i.imgur.com/ZrGQNlo.png) ### Step 4: Remove the Existing kernel before rebooting. (Make sure your right the correct version in the commands as per your system) ![](https://i.imgur.com/duWMbZ4.png) ### Step 5: Reboot Ubuntu and enjoy the new Linux kernel. > Now you’ve installed new kernel in Ubuntu successfully, it’s time to reboot the machine. Ubuntu by default boots into the newer kernel version. > > After rebooting, check kernel version with same uname -sr command you used earlier. As you can see, it’s updated to 5.7.0 ![](https://i.imgur.com/kS26NBa.png)