mainline kernel now depends on libc6 2.33, non-installable in focal?

28,494

Solution 1

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" -> ""

Solution 2

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

Solution 3

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.

Share:
28,494

Related videos on Youtube

usretc
Author by

usretc

Updated on September 18, 2022

Comments

  • usretc
    usretc almost 2 years

    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.

    • Admin
      Admin about 3 years
      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)
    • Admin
      Admin about 3 years
      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.
    • Admin
      Admin about 3 years
      I'm using the mainline kernel 5.11.16 with ubuntu 20.04. But from the kernel 5.11.17 it required libc >= 2.33. Hopefully they will revert this change.
    • Admin
      Admin about 3 years
      Hopefully, it seems completely gratuitous. I've tried 5.11.17 too.
    • Admin
      Admin about 3 years
      I just opened a bug on Mainline here: bugs.launchpad.net/umkl/+bug/1927024
    • Admin
      Admin about 3 years
    • Admin
      Admin about 3 years
      PPAs included in answer
    • Admin
      Admin about 3 years
      @TuxInvader unfortunately your packages linux-headers* do not contain Makefile required for dkms
    • Admin
      Admin about 3 years
      @sercxjo, perhaps open an issue on the project page? github.com/TuxInvader/focal-mainline-builder/issues
    • Admin
      Admin about 3 years
      @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.
    • Admin
      Admin about 3 years
      @TuxInvader Thanks for the fix and for the metapackage!
    • Admin
      Admin almost 3 years
      @tuxinvader I ran into similar issue on Ubuntu MATE 21.04 while trying to install kernel 5.14.3. Any way out of this error? dpkg: dependency problems prevent configuration of linux-headers-5.14.3-051403-generic: linux-headers-5.14.3-051403-generic depends on libc6 (>= 2.34); however: Version of libc6:amd64 on system is 2.33-0ubuntu5. Thank you.
  • usretc
    usretc about 3 years
    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
    usretc about 3 years
    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
  • Doug Smythies
    Doug Smythies about 3 years
    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.
  • usretc
    usretc about 3 years
    upvoted, good for you, but it seems like this hack is the answer to another question :)
  • khester
    khester about 3 years
    super useful tip. thanks!
  • usretc
    usretc about 3 years
    Good. There are now also PPAs for 5.10 / 5.11 (see comments, answer needs updating)
  • estibordo
    estibordo about 3 years
    Thanks @usretc for keeping the question updated. It was much easier to find a work around.
  • Caballero
    Caballero almost 3 years
    This approach no longer works with the latest kernel. I'm getting ERROR (dkms apport): kernel package linux-headers-5.14.1-051401-generic is not supported