New install: Nix wants glibc 2.38, Debian 12 has 2.36

How can I get Nix working without hosing my system?

❯ nix-shell -p nix-info --run "nix-info -m"
bash: /usr/lib/x86_64-linux-gnu/ version `GLIBC_2.38' not found (required by bash)

Can confirm, I do have GLIBC 2.36-9 installed.

❯ ldd --version                  
ldd (Debian GLIBC 2.36-9+deb12u3) 2.36

I’d attempt digging up an old version of nix from hydra. Looks like the 22.11 or 22.5 nixpkgses may have had a nix built with glibc 2.36. Nix can then run and update itself (with a glibc 2.38 to go along that won’t interfere with the rest of your system).

Alternatively, grab the source code and build from scratch.

Edit: oh, hrm, this is bash being complained about. I haven’t used nix-shell in a while, why is it using your host’s glibc to run a bash linked against a newer glibc? Is it actually running bash from the nix store, but maybe the nix you’re using is under an older glibc causing that to propagate because you haven’t explicitly updated it?

Do other nix commands work? E.g. nix-env -q?

Nix-built software won’t (and shouldn’t) use Debian’s libc unless the environment overrides its behaviour using something like LD_LIBRARY_PATH


@TLATER , @SergeK

Thanks for the responses!
There is no output from nix-env -q

My LD_LIBRARY_PATH was set to /usr/lib/x86_64-linux-gnu, and I’m not sure why. I unset it, and can do things like:

❯ nix-env -q                

❯ nix-shell -p cowsay lolcat

[nix-shell:~]$ cowsay Nix is working
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
< Nix is working >
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

[nix-shell:~]$ echo Nix is working | lolcat
Nix is working

So I’m not sure how to proceed now. That LD_LIBRARY_PATH is set is my .zshrc, but there’s no commentary about why it is there. There’s a crapload of symlinks and folders in /usr/lib/x86_64-linux-gnu.

Frankly, setting LD_LIBRARY_PATH at all is a massive red flag. I’d remove it and see if anything breaks, likely nothing will, and some things may suddenly unbreak.


Thanks for the help @SergeK and @TLATER !

1 Like