- Clone the kernel git repository with: git clone https://aur.archlinux.org/linux-lts318.git to directory where you're going to build the kernel.
- Add Linus Torvalds and Greg KH keys to list of trusted keys in pacman "database" of trusted keys:
$ sudo pacman-key -r 00411886 $ sudo pacman-key -r 6092693E
- Import Linus Torvalds and Greg KH public key to your machine if you haven't done that already.
$ gpg --recv-keys 79BE3E4300411886 $ gpg --recv-keys 38DBBDC86092693E
Be patient, as it could take a while searching and importing the keys. - Now, you can proceed to build the kernel in the git-cloned directory in step 1. cd into the directory and makepkg:
$ makepkg -s
The -s flag is to make sure that all dependencies are downloaded while building the custom kernel package. - Assuming the kernel package build is finished, you can proceed to install the kernel headers and the kernel itself:
# pacman -U linux-lts318-headers-3.18.20-1-x86_64.pkg.tar.xz # pacman -U linux-lts318-3.18.20-1-x86_64.pkg.tar.xz
You are advised to install kernel header first before installing the kernel as mentioned in https://wiki.archlinux.org/index.php/Kernels/Compilation/Arch_Build_System#Installing - Once the kernel is installed, the remaining step is to update your machine bootloader. If you are using systemd bootloader (a.k.a gummiboot), all you need to do is modify /boot/loader/entries directory to include entry for the new kernel. For example: Create a new arch-lts.conf file in /boot/loader/entries with the following contents:
title Arch Linux 3.18 LTS AUR linux /vmlinuz-linux-lts318 initrd /initramfs-linux-lts318.img options root=PARTUUID=[your_root_partition_UUID] rw
NOTE:
- If you have dirmngr problem showing up in your shell, it's probably because you haven't run it yet. You should run it as root:
# dirmngr < /dev/null
See: Pacman-key#gpg:_keyserver_receive_failed:_No_dirmngr - See also GnuPG section in Arch Wiki for more details.
- If you'd rather prevent future kernel upgrade when upgrading packages via pacman -Syu, you can add this line to /etc/pacman.conf:
IgnorePkg = linux
The line will prevent pacman from upgrading the linux kernel (linux package).