Has anyone seen this GLIBC error in nix commands before?

Hi, I’ve recently updated and started running into a strange error with nix-shell, nix-env, nix etc.

nix-shell: /nix/store/jsp3h3wpzc842j0rz61m5ly71ak6qgdn-glibc-2.32-54/lib/libc.so.6: version `GLIBC_2.33' not found (required by /nix/store/7fv9v6mnlkb4ddf9kz1snknbvbfbcbx0-gcc-10.3.0-lib/lib/libstdc++.so.6)

From looking around, this seems to be caused when running binaries from the internet that have been compiled against the wrong version of GLIBC. The strange thing is that nix-shell is provided by NixOS, and should be compiled against the system GLIBC, so I’m not sure why it (or libstdc++.so.6) would be compiled against the wrong one. I can’t even install new tools like this, so I’ve had to rollback to a previously working system generation.

Any advice where to look to diagnose this problem?

1 Like

When googling around a bit more you will notice this is a recurring theme when mixing different releases of nixpkgs. Check if you have overlays that pick packages from a different release than the rest of the package collection. To get a feel for it, you can try nix-tree and inspect the offending package’s dependencies. It’s possible to work around this in multiple ways, one of them being to build the “foreign” package with “local” dependencies through callPackage.

1 Like

Another thing that could cause this is having an ancient channel for your user, but an up-to-date one for your system.

Check nix-channel --list and sudo nix-channel --list (and --update both while you’re there).


I had PyCharm installed from an older channel, and had run it in that terminal before. it somehow infected the environment for that shell and caused the failures. After a reboot, i couldn’t reproduce it until i had run pycharm again.