You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



Linux Lite kernel update HOWTO

Author (Read 11211 times)

0 Members and 2 Guests are viewing this topic.

Linux Lite kernel update HOWTO
« Reply #1 on: June 23, 2018, 02:54:00 PM »
 

kpanic

  • PayPal Supporter
  • Forum Regular
  • *****
  • 162
    Posts
  • Reputation: 67
  • Linux Lite Member
    • View Profile

  • CPU: Core i5 M450

  • MEMORY: 8Gb

  • VIDEO CARD: Nvidia GT216
IMPORTANT: Please, do not use this HOWTO if you have installed proprietary drivers
                      from the installation package! (Yes, this is why Open Source is so cool! )

This HOWTO is mainly for LL power users and I recommend that if you don't have experience how to
update (or create a customized) Linux kernel from the source, then please don't use this guide or
use it on your own responsibility - as always.

Before doing anything, you need to make sure that you have the developer tools installed.
So, open the terminal, become root and install them..

Code: [Select]
sudo su
Code: [Select]
apt-get install build-essential libncurses5-dev libssl-dev ccache wget bison flex
Then close all the unnecessary applications, except the web browser.

Then, open the terminal and become root, this should be obvious :)
and cd to /usr/src If that directory does not exist, then create it and cd to it.
Make also your terminal window bigger, so that it is easier to read.
Then go to www.kernel.org with your web browser and see what is the latest stable kernel.

In this example we assume that the latest stable release is 4.17.2
So, in your terminal, download the kernel (you can copy the download link location from there)
to your /usr/src directory using command (assuming the kernel is 4.17.2):
Code: [Select]
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.17.2.tar.xz
Then wait... it will take some time to download it. When the download is finished, extract the package:
Code: [Select]
tar -xf linux-4.17.2.tar.xz
You may now close the web browser, if it is still open.
Create a symbolic link to the source tree, cd into the source and copy the configuration there
and begin the customization of your specific hardware -
So first, while still in /usr/src directory,  do:
Code: [Select]
ln -s linux-4.17.2 linux
Code: [Select]
cd linux
Code: [Select]
cp /boot/config-$(uname -r) ./.config
Code: [Select]
make menuconfig
Here you may make any modifications as you please. For example, if you have a multicore
Intel processor, then you can take the most out of it by selecting it here, instead of running
a "generic x86_64" configuration.

But if you don't have previous experience how to choose these options consistently,
then I suggest that you just click the 'TAB' button a few times until the 'SAVE' is highlighted,
and press 'ENTER'. Then the same to 'EXIT'.

Now, you can compile your kernel, command:
(If your processor has 2 cores, the make option is -j3)
(If your processor has 4 cores, the make option is -j5)
(Just number of cores +1 )
You may find the number of cores like this, for example:
Code: [Select]
echo Nr Cores: `expr $(lscpu | grep Socket\(s\) | awk '{print $2}') \* $(lscpu | grep Core\(s\) | awk '{print $4}')`It's not really important here actually. If you don't know it, just leave the '-j' option out of the following 'make' command.

This 'make' command builds your own kernel !
Code: [Select]
make -j3 2&>1 > /root/compile.log
Now, this may take over an hour or more to finish, so let your
computer be and go watch TV or something (and remember to eat).

If everything did NOT went fine and you got some error message in the end,
then there is no problem. But your kernel did not update and you
don't need to read the rest of this HOWTO. Or you may send me a post
of your error message and IF I HAVE TIME, I will answer to it.
Or, maybe some helpful LL user will reply..
Anyway, you will find the log file of the whole process
in the file: /root/compile.log
You may open it with a text editor and try to find warning- and/or error
messages.

But if everything went fine and there are no error messages on the
last lines, then you may install the new modules:
Code: [Select]
make modules_install
Then wait until it installs... and finally install the new kernel
Code: [Select]
make install
Again, wait until it finishes..

Reboot and see how it works.
After reboot, check the kernel version:
Code: [Select]
uname -r
Well done, you are running the latest stable kernel - like mama used to made 'em!

Well, If your kernel version is still the old one, it may be that you need to run:
Code: [Select]
sudo update-initramfs -u
...and wait a moment ...and reboot again

That's all this time folks!

« Last Edit: July 12, 2018, 10:11:00 PM by kpanic »
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section