Ask us anything about Ubuntu Kernels!

@zika
As this was already asked a number of times, you have the answer above. Whenever Canonical decides a mainline kernel is needed for their testing a new kernel will be provided.

Not the answer I wanted either but if you need a kernel take the time and build it yourself. Happy config editing … rinse and repeat.

Ubuntu 22.04 LTS

Would there be a way to upgrade the kernel in the update GUI in the future? This is one thing I liked about Lunux Mint – that I could update to newer kernels within update manager.

@agentl074
Mainline has a nice GUI and CLI for adding and removing the Ubuntu mainline kernels.
https://github.com/bkw777/mainline

2 Likes

Thanks I disagree removing the mainline kernels…
With the latest approved Kernel for Ubuntu is the at most approved
kernel by Canonical… https://ubuntu.com/community/canonical
Their are a lot more… Server ? https://ubuntu.com/download/server
https://canonical.com/
https://ubuntu.com/download/desktop
https://www.kernel.org/
How often does a Ubuntu Kernel change versions ?
Yearly or just by version release of the kernel ?
I have installed the bleeding edge kernel a few times.
Worked … other times I helped with the bugs…
Persistence makes Ubuntu better.
How does Ubuntu decide to go with New kernel releases?

You would think that Ubuntu would be appreciative of users testing kernels on their systems and reporting any issues they find, even if it were the non-rc one’s like 6.0, 6.1 and 6.1.1 stable.

1 Like

Canonical has a business to run. If their business does not need a new kernel built for their testing then no one has the time or resources to fix any breakage with the automated mainline kernel builds.

Until Canonical chooses which new Linux kernel to use for Lunar Lobster testing it is unlikely for these mainline kernel builds to be fixed. I suspect Canonical will pick 6.1 as it is an LTS kernel but the Lunar release is not an Ubuntu LTS so who knows ?

Anyway Feature Freeze is the end of February, so for sure it will be fixed by sometime in February.
Also Ubuntu Testing week is in March.
See Lunar Lobster Release Schedule

I want to specify the kernel version to 5.4.0-125, but the code i use in user-data doesn’t work . When install the OS , it will always update to 5.4.0-150.
kernel:
package: linux-image-5.4.0-125-generic

How do you install the OS? Is this cloud-init user-data? If so, can you post your cloud-init config?

Yes, I use the cloud-init user-data to install os automatically.
My config file :
autoinstall:
version: 1
refresh-installer:
update: no
#Network configuration for DHCP
network:
network:
version: 2
ethernets:
any:
match:
name: eno*
dhcp4: true

Identity and HostName

identity:
hostname: localhost-sut
username: ubuntu
password: “*”
ssh:
allow-pw: true
authorized-keys: []
install-server: true

Timezone setting

timezone: ‘Asia/Shanghai’

APT setup

apt:
primary:
- arches:
- default
uri: http://100.109.32.49/ipxe/os/ubuntu/20.04.5/
kernel:
package: linux-image-5.4.0-125-generic
keyboard:
layout: us
toggle: null
variant: ‘’
locale: en_US.UTF-8
source:
id: ubuntu-server
search_drivers: false
storage:
layout:
name: lvm
updates: security

please add three backticks ``` in the line before and after any code you paste, so the indentation stays intact else your paste will be unreadable …

Hi, this is not really a kernel question, but a question about Subiquity installer, autoinstall option. It’s best to ask about it at Please test autoinstalls for 20.04! - #32 by mwhudson

In general, Ubuntu updates are rolling, meaning your kernel just like all the other packages will be upgraded. 5.4.0-125 is a very old kernel build which is no longer supported. It is not recommended to install individual kernel ABI packages, and instead you should only install the meta that will keep your systems updated (as is done by default).

Why are you trying to install an obsolete and security vulnerable build of v5.4 kernel, when latest abi is 150?

2 Likes

Yes, it is a question for installer . But i am not sure why it will always be upgraded to the newest .

My customer required to use the stable kernel version ,so i need to hold the kernel the special verison.

I have find the solution and thank you for your clarify and advise .Thank you

Did you make your customer at least aware that you are installing something with well known and documented vulnerabilities so that hackers even have a tutorial how to break in ? You seem to be doing your customer quite a disservice here if you do not try to convince them to use a kernel with the fixes…

2 Likes

On my Dell inspiron I have a problem wit kernel 6.x: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2015670
and I am forced to use a 5.x kernel
may you help me?
thanks

Hm. Looks familiar to something I’m seeing with a Realtek NIC but with kernel 5.19. Can you try to add kernel commandline pcie_aspm=off.

Can you guys jump to latest kernel 6.3 for ubuntu 22.04?

it has tremendous speed up for io_uring applications.

The 22.04.4 release in Q1 24 will have a kernel later than 6.3. Or also the 23.10 release in Q4 23.

I am trying to build kernel 6.2.0-26 on jammy for amd64-generic with unchanged configuration. Unfortunately, it does not run through, tools/bpf/bpftool/vmlinux cannot be found.

For the build I have installed the following packages:

libncurses-dev gawk flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev debhelper binutils-dev python-is-python3 libiberty-dev pahole libreadline-dev llvm ubuntu-dev-tools libdw-dev systemtap-sdt-dev libunwind-dev libslang2-dev libzstd-dev libcap-dev libbabeltrace-ctf-dev openjdk-8-jdk libtraceevent-dev

Additional packages for Rust:

rustc cargo llvm-15 lld-15 clang-15 wasi-libc bindgen librust-core-foundation-dev rust-src

The build process is:

$ make olddefconfig
[...]
# using defaults found in /boot/config-6.2.0-26-generic
#
#
# configuration written to .config

$ LANG=C fakeroot debian/rules clean
[...]

$ LANG=C fakeroot debian/rules binary
[...]
  CC      util/expr-flex.o
  CC      pmu-events/pmu-events.o
  LD      util/intel-pt-decoder/perf-in.o
  LD      util/perf-in.o
  LD      pmu-events/pmu-events-in.o
  LD      perf-in.o
  LINK    perf
make[1]: Leaving directory '/[...]/debian/build/tools-perarch/tools/perf'
mv /[...]/debian/build/tools-perarch/tools/bpf/bpftool/vmlinux /[...]/debian/build/tools-perarch/vmlinux
mv: cannot stat '/[...]/debian/build/tools-perarch/tools/bpf/bpftool/vmlinux': No such file or directory
make: *** [debian/rules.d/2-binary-arch.mk:749: /[...]/debian/stamps/stamp-build-perarch] Error 1

Can you please try

mk-sbuild jammy
pull-lp-source linux-hwe-6.2 jammy
sbuild -A -d jammy ./linux-hwe-6.2*.dsc

And does that work?

Separately, you can also try this instructions instead Kernel/BuildYourOwnKernel - Ubuntu Wiki

Note that ubuntu kernels do not use “make olddefconfig” to compile the kernel, instead we use annotations, and you can use commands like fakeroot debian/rules editconfigs if you want to change them.

mk-sbuild asked me for an email address, and it seemed mandatory. I have put a valid one, leading to:

Error reading configuration: MAILPROG binary ‘/usr/sbin/sendmail’ does not exist.

I could figure out that I can set $mailto = ''; in .sbuildrc, more appropriate for a local build.

The second command ran through, but I had to cd to directory level one up compared to $build_dir and $log_dir before executing it to have some order.

The last command leads to the following output, and I do not know how to deal with it:

sbuild (Debian sbuild) 0.81.2ubuntu6 (16 February 2022) on malah

+==============================================================================+
| linux-hwe-6.2 6.2.0-32.32~22.04.1 (amd64)    Tue, 22 Aug 2023 01:45:07 +0000 |
+==============================================================================+

Package: linux-hwe-6.2
Version: 6.2.0-32.32~22.04.1
Source Version: 6.2.0-32.32~22.04.1
Distribution: jammy
Machine Architecture: amd64
Host Architecture: amd64
Build Architecture: amd64
Build Type: binary

W: No chroots are defined in ‘/etc/schroot/schroot.conf’ or ‘/etc/schroot/chroot.d’
E: Error creating chroot

+------------------------------------------------------------------------------+
| Summary                                                                      |
+------------------------------------------------------------------------------+

Build Architecture: amd64
Build Type: binary
Build-Space: 0
Build-Time: 0
Distribution: jammy
Fail-Stage: create-session
Host Architecture: amd64
Install-Time: 0
Job: ./linux-hwe-6.2_6.2.0-32.32~22.04.1.dsc
Machine Architecture: amd64
Package: linux-hwe-6.2
Package-Time: 0
Source-Version: 6.2.0-32.32~22.04.1
Space: 0
Status: failed
Version: 6.2.0-32.32~22.04.1
--------------------------------------------------------------------------------
Finished at 2023-08-22T01:45:07Z
Build needed 00:00:00, 0k disk space
E: Error creating chroot