Error: Setup: The pkg-config package 'nix-store' version >=2.4 && <2.17 is required but the version installed on the system is version 2.18.1

Hi,

I’m trying to upgrade a 23.11 nixos, but it shows an error:

# ...
CallStack (from HasCallStack):
  withMetadata, called at libraries/Cabal/Cabal/src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0:Distribution.Simple.Utils
Error: Setup: The pkg-config package 'nix-store' version >=2.4 && <2.17 is
required but the version installed on the system is version 2.18.1

error: builder for '/nix/store/fbv2yjms21832jzzia2alylm2qgmnwxy-hercules-ci-cnix-store-0.3.4.0.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/0qdrplwj13irhsqxr827hg98cas93bw5-cachix-1.6.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/yk5cxc71k48jaid6rd6s13cx5b14991f-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/3jwj0cdwqkd2xygycwq2h58n01ppnfhk-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/bgfi7xxi93i1g2j3w9ydcmxlnp2y8gbn-user-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/bj2c7v27f9ybnryjd5zdc0fq873n2ahz-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/kacig6ir5s3c3a9drf35piy1aslrvzw7-nixos-system-nixos-23.11.5195.2be119add7b3.drv' failed to build

[root@nixos:~]# nixos-rebuild boot --upgrade

I tried both nixos-rebuild **boot** --upgrade and nixos-rebuild **switch** --upgrade but it shows the same error.

Any advice is appreciated, thanks!

This was reported here. Hopefully, it will be fixed soon.

1 Like

That was fixed already in

but as usual, if you’re using channels, they can lag behind a bit.

2 Likes

Can confirm it is fixed. Thanks for the responses!

Thanks for fix, I saw it as well