I wanted to install a new kernel.

I am currently running Ubuntu 20.04 LTS on my main computer at home. This is my desktop PC which I use for “fun” projects, browsing, and gaming.

I have recently purchased some new bits for it, in particular a new motherboard and a ryzen 5600 cpu. My new mobo uses the r8125 chipset for ethernet.

While I upgraded the parts a while back, there are two main things I have noticed that I do not have hardware support on my current kernel for.

The first is k10temp, which should allow me to monitor the temperature of my CPU. This is available in kernel 5.10, according to this link.

Similarly, the ethernet chipset support comes in 5.9 (I think, I haven’t really seen much of an official source…)

My current kernel (on ubuntu 20.04) is 5.4.

[email protected]:~$ uname -r

Ok, so I need to update this to 5.10.

After some googling, it seems like the easiest way to manage kernels is to either use the mainline GUI program or this script (ubuntu-mainline-kernel.sh (github))

I tried the script.

[email protected]:~$ wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh
--2021-01-26 20:14:36--  https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26474 (26K) [text/plain]
Saving to: ‘ubuntu-mainline-kernel.sh’

ubuntu-mainline-kernel.sh 100%[===================================>]  25.85K  --.-KB/s    in 0.01s   

2021-01-26 20:14:37 (2.64 MB/s) - ‘ubuntu-mainline-kernel.sh’ saved [26474/26474]

[email protected]:~$
[email protected]:~$ chmod +x ubuntu-mainline-kernel.sh
[email protected]:~$ sudo mv ubuntu-mainline-kernel.sh /usr/local/bin/
[email protected]:~$
[email protected]:~$ sudo ubuntu-mainline-kernel.sh -i
Finding latest version available on kernel.ubuntu.com
Latest version is: v5.10.10, continue? (y/N) 
Will download 6 files from kernel.ubuntu.com:
Downloading amd64/linux-headers-5.10.10-051010-generic_5.10.10-051010.202101231639_amd64.deb: 100%   
Downloading amd64/linux-headers-5.10.10-051010_5.10.10-051010.202101231639_all.deb: 100%   
Downloading amd64/linux-image-unsigned-5.10.10-051010-generic_5.10.10-051010.202101231639_amd64.deb:  100%   
Downloading amd64/linux-modules-5.10.10-051010-generic_5.10.10-051010.202101231639_amd64.deb: 100%   
Downloading amd64/CHECKSUMS: 100%   
Downloading amd64/CHECKSUMS.gpg: 100%   
Importing kernel-ppa gpg key ok
Signature of checksum file has been successfully verified
Checksums of deb files have been successfully verified with sha256sum
Installing 4 packages
Cleaning up work folder
[email protected]:~$ ubuntu-mainline-kernel.sh -l
[email protected]:~$

Now to reboot and see what happens!

I rebooted and it worked. And now my cpu temperature sensor works too!

[email protected]:~$ uname -r
[email protected]:~$ 
[email protected]:~$ 
[email protected]:~$ 
[email protected]:~$ 
[email protected]:~$ 
[email protected]:~$ sensors
Adapter: PCI adapter
vddgfx:      700.00 mV 
fan1:           0 RPM  (min =    0 RPM, max = 3200 RPM)
edge:         +34.0°C  (crit = +110.0°C, hyst = -273.1°C)
                       (emerg = +115.0°C)
junction:     +34.0°C  (crit = +105.0°C, hyst = -273.1°C)
                       (emerg = +110.0°C)
mem:          +34.0°C  (crit = +105.0°C, hyst = -273.1°C)
                       (emerg = +110.0°C)
power1:        6.00 W  (cap = 135.00 W)

Adapter: ACPI interface
temp1:        +16.8°C  (crit = +20.8°C)

Adapter: PCI adapter
Tctl:         +45.0°C  
Tdie:         +45.0°C  

[email protected]:~$