Friday, July 19, 2019

How to Install Linux Kernel 4.4 in Ubuntu 18.04

The default kernel line for Ubuntu 18.04 LTS is 4.18
I have a Chromebook ASUS C300 and the sound card is  working fine with kernel 4.4 line but not with 4.18, the 4.4 line corresponds to the Ubuntu 16.04 LTS

So I downloaded from the Ubuntu kernels server
https://kernel.ubuntu.com/~kernel-ppa/mainline/
The latest update in the 4.4 line which at this moment is 4.4.185:

linux-headers-4.4.185-0404185_4.4.185-0404185.201907100448_all.deb
linux-headers-4.4.185-0404185-generic_4.4.185-0404185.201907100448_amd64.deb
linux-image-unsigned-4.4.185-0404185-generic_4.4.185-0404185.201907100448_amd64.deb
linux-modules-4.4.185-0404185-generic_4.4.185-0404185.201907100448_amd64.deb

Then it can be installed with the command:
sudo  dpkg  -i  *.deb

You can see a list of your installed kernels with the following command:
dpkg --list | grep linux-image

I'm keeping only the latest versions of the two official lines, we can remove any older version of the 4.4 or the 4.18 with the command:
sudo apt remove linux-image-4.x.x-xxxxxxx-lowlatency

then
sudo apt autoremove

Then we do:  sudo update-grub

We have to edit our grub file to set the default booting kernel
https://forums.gentoo.org/viewtopic-t-1060880-start-0.html

sudo vim /etc/default/grub

In Grub2 we have two different screens before the selection of the kernel, you can check them hitting the "esc" key before the booting. The numbers begin with 0 for the first selection, 1 for the second, and so on. In my case the grub configuration file has the following values for the default, where the number 1 corresponds to the selection in the first screen and the number 2 correspond to the selection for the second screen before the actual boot:

GRUB_DEFAULT="1>2"

Other necessary changes
GRUB_TIMEOUT=10
and comment out either: 
#GRUB_HIDDEN_TIMEOUT=0
or
#GRUB_TIMEOUT_STYLE=hidden

Save & exit.

Then we have to commit with: sudo update-grub

If for some reason we need a higher kernel version, another solution could be downloading the corresponding driver for our sound card and recompiling it for the new kernel.

UPDATE: Up to the kernel 4.4.220 the sound and mic work fine, I have tested kernels beyond that version and the sound is not working. 
I also tried all this in Ubuntu 20.04 but there were broken dependencies for the kernel 4.4.220

----///

Creating Bootable USB Stick On Linux Using Command Line

dd if=~/home/username/path/to/myfile.iso of=/dev/sdb

dd bs=4M if=/path/to/myfile.iso of=/dev/sdx status=progress oflag=sync


----///