25

I've been happily installing 5.10 mainline kernels (from https://kernel.ubuntu.com/~kernel-ppa/mainline/) on my Ubuntu 20.04.

Trying to update to 5.10.33, I discovered an unwelcome dependency on libc >=2.33 (focal is at 2.31) for the -headers package (though not the image itself -- but who wants to live without the headers).

AFAIK, libc6 is next to impossible to upgrade. Is this... it? Am I stuck at 5.10.32 unless I give up LTS? Do these folks even have a public-facing site where one can report bugs?

Update: This seems to be the main launchpad bug. A good thing that came out of it: tuxinvader has come up with a Docker container (source on Github: focal-mainline-builder) for building kernel mainline images and uploaded 5.10 - 5.12 packages to his PPAs:

Tip: To see all available linux packages for your chosen series / version range, after messing with PPAs and maybe Debian backports, xanmod etc (as I have) do something like

apt update
printf '%s\0' linux-{image-unsigned,headers,modules}-5.10.{32..40} |
  xargs -0 -n 1 apt-cache pkgnames | LC_ALL=C sort | less

Hopefully this problem will go away. But let's face it, depending on the whims of the "kernel mainline PPA" (or whoever is behind it, I still don't understand how these developers can be reached) for binaries has not been a pleasant experience.

11
  • The next HWE kernel with focal will be 5.11 (20.04.3) which is what I would have opted to stick to (ie. HWE proposed kernels) but I haven't monitored how closely that is to being ready (it's still a bit far off to worry about QA-testing it yet; as it's been stable on hirsute for some time which is where all recent focus has been) – guiverc Apr 28 at 22:43
  • 2
    Oh gosh. That is a huge problem for me. I had not yet got around to installing mainline kernel 5.12 on my main 20.04 test server, and yes get the issue you mention. kernel 5.12-rc6 was fine. Darn. – Doug Smythies Apr 28 at 23:40
  • 6
    I just opened a bug on Mainline here: bugs.launchpad.net/umkl/+bug/1927024 – khester May 4 at 0:51
  • 1
  • 1
    @sercxjo - The linux-headers issue is fixed. Someone opened an issue on github yesterday (as suggested by @usretc). DKMS should work fine now. I've also added a metapackage which will make it easier to get updates and avoid needing to install each point release manually. – TuxInvader May 28 at 14:37
6

You can stay with LTS, but you will need to compile the mainline kernels yourself to overcome the new dependency issue.

The mainline compiler version used seems to have just changed:

doug@s19:~/temp-k-git/linux$ scripts/diffconfig .config-5.12.0-051200rc6-lowlatency .config-5.12.0-051200-lowlatency
 CC_VERSION_TEXT "gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0" -> "gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0"
 GCC_VERSION 100200 -> 100300
 LD_VERSION 23501 -> 23601
+DEBUG_INFO_BTF_MODULES y
+PAHOLE_HAS_SPLIT_BTF y

But if I just take the Ubuntu kernel configuration and compile myself, on my main 20.04 test server, it installs fine. I.E. the dependency is a function of the compiler version used not the kernel source code.

Not really relevant but here is the config difference for what I compiled:

doug@s19:~/temp-k-git/linux$ scripts/diffconfig .config-5.12.0-051200-lowlatency .config
-DEBUG_INFO_BTF y
-DEBUG_INFO_BTF_MODULES y
-DEBUG_INFO_COMPRESSED n
-DEBUG_INFO_DWARF4 y
-DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT n
-DEBUG_INFO_REDUCED n
-DEBUG_INFO_SPLIT n
-GDB_SCRIPTS y
-PAHOLE_HAS_SPLIT_BTF y
 CC_VERSION_TEXT "gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0" -> "gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0"
 DEBUG_INFO y -> n
 GCC_VERSION 100300 -> 90300
 LD_VERSION 23601 -> 23400
 SYSTEM_TRUSTED_KEYS "debian/canonical-certs.pem" -> ""
3
  • 2
    It's also possible that the gcc change was inadvertent and they might revert it, I think I've seen that happen in the past – usretc Apr 29 at 1:25
  • Doug, good find, there's so much outdated howto advice for Ubuntu out there that I essentially gave up a while ago. It might also be possible to backport to a PPA, though I remember with kernel packages it's not that easy – usretc Apr 29 at 1:27
  • 1
    Given that for many bugs on Launchpad there is a request to "try the latest mainline kernel" it seem likely that it will be made to work, either by compiler reversion or libc update. – Doug Smythies Apr 29 at 13:25
5

Here is how i made dkms modules generated with kernel 5.11.18 from ubuntu mainline-kernel. I run Linux Mint 20.1 Cinnamon and use nvidia-driver-460 version 460.73.01-0ubuntu0.20.04.1 in dkms. The gcc I use is version 10.3. Everything worked fine with ver 5.11.16-generic but stopped when i tried 5.11.18. So I tried to find the problem why dkms did not compiled the kernel modules. This is what I did:

  1. Installed kernel 5.11.18-generic
  2. Found that in kernel headers program fixdep relates to glibc 2.33
  3. Found that in kernel headers program modpost relates to glibc 2.33
  4. Replaced /lib/modules/5.11.18-generic/build/scripts/basic/fixdep with the one in 5.11.16
  5. Replaced /lib/modules/5.11.18-generic/build/scripts/mod/modpost with the one in 5.11.16
  6. Ran dkms against kernel 5.11.18 (/usr/lib/dkms/dkms_autoinstaller start 5.11.18-051118-generic)
  7. Successfully generated nvidia kernel modules. Rebooted and it works ok. Even tried the same with kernel 5.12.1 and it worked.

Hope this helps.

2
  • 1
    upvoted, good for you, but it seems like this hack is the answer to another question :) – usretc May 3 at 21:04
  • 1
    super useful tip. thanks! – khester May 4 at 0:38
3

I was able to install 5.12 on Ubuntu 20.04 with libc6 2.31 using the mentioned ppa:

sudo add-apt-repository ppa:tuxinvader/lts-mainline

sudo apt install linux-image-unsigned-5.12.4-051204-generic linux-modules-5.12.4-051204-generic linux-headers-5.12.4-051204-generic
2
  • Good. There are now also PPAs for 5.10 / 5.11 (see comments, answer needs updating) – usretc May 18 at 18:37
  • Thanks @usretc for keeping the question updated. It was much easier to find a work around. – estibordo May 18 at 22:35
0

Another easy option to stay with 5.10, without compiling, seems to be to use a custom kernel. Like xanmod. The thing is, they don't seem to put much effort into "performance" improvements for the older LTS series, so I think one might be getting a pretty standard kernel. For example this is the log for xanmod 5.10.35.

Not the answer you're looking for? Browse other questions tagged or ask your own question.