How to manually install a new Linux kernel in Manjaro and switch to it. (via commandline/terminal)

tutorial
kernel

#1

In Manjaro it’s quite easy to install a new kernel and switch to it via the Manjaro Settings Manager, a great GUI. However there are certain scenarios where you want or need to do this via a terminal.

So here’s how to manually install a new Linux kernel in Manjaro and switch to it via commandline/terminal.

1. Download the following packages (change the kernel version number accordingly). If you use VirtualBox, then also install the relevant VirtualBox modules:

linux414
linux414-ndiswrapper
linux414-headers
linux414-virtualbox-host-modules

You can install the packages via pacman using a single command:

sudo pacman -S linux414 linux414-ndiswrapper linux414-headers linux414-virtualbox-host-modules

2. Switch to the new kernel using the following command:
sudo mhwd-kernel -i linux414

3. Reboot

4. Check if the switch to the new kernel was successful by entering the following command in a terminal:
uname -a

If no switch to the new kernel has taken place, try rebooting and switching to the new kernel using the Grub menu. (advanced options)

5. If you want to update the kernel later on, then simply download and install the latest versions of the (above) kernel packages. Don’t forget to sync with the repository servers first, so that you can search and download the latest package versions via pacman:
sudo pacman -Syy

The following command updates the packages. It’s wrapped onto multiple lines, but it is one command:
sudo pacman -S linux414 linux414-ndiswrapper linux414-headers linux414-virtualbox-host-modules


Are the stats really believable
#2

Glad to see you here again. :slight_smile:


#3

You don’t need step 2. if you ran step 1. and vice versa.
Edit: See what happens if you try to install linux414-extramodules

eugen@mjaro ~> sudo pacman -S linux414-extramodules
:: There are 14 members in group linux414-extramodules:
:: Repository extra
   1) linux414-acpi_call  2) linux414-bbswitch  3) linux414-broadcom-wl  4) linux414-catalyst
   5) linux414-ndiswrapper  6) linux414-nvidia  7) linux414-nvidia-304xx
   8) linux414-nvidia-340xx  9) linux414-nvidiabl  10) linux414-r8168  11) linux414-tp_smapi
   12) linux414-vhba-module  13) linux414-virtualbox-guest-modules
   14) linux414-virtualbox-host-modules


Enter a selection (default=all): 1 3 8 10 13 14
resolving dependencies...
looking for conflicting packages...

Packages (8) linux414-4.14rc2.20170927.g9cd6681-1  nvidia-340xx-utils-340.104-1
             linux414-acpi_call-1.1.0-0.5  linux414-broadcom-wl-6.30.223.271-0.5
             linux414-nvidia-340xx-340.104-0.5  linux414-r8168-8.044.02-0.5
             linux414-virtualbox-guest-modules-5.1.28-0.5
             linux414-virtualbox-host-modules-5.1.28-0.5

Total Download Size:    96.54 MiB
Total Installed Size:  238.29 MiB

:: Proceed with installation? [Y/n]

Then you can select what modules you need. Enter numbers separated by spaces and hit Enter. linux414 should get installed automatically as a dependency.
Edit2: I don’t use any extramodules, therefore I’m not suggesting that the selection is correct.


#4

Why should be VB Guest and VB Host modules needed?
You need either one or the other !