I have trouble using gcc in OSX.

I want to the gcc that comes with XCode (Apple LLVM version 10.0.1 (clang-1001.0.46.4)). However on my PATH this gcc (gcc (GCC) 7.4.0) is taken precedent.

$ which gcc

Is there anyway I can turn off/deactivate this particular package? I have checked the documentation but the main commands such as nix-env, nix-store etc do not offer any escape hatch.

I tried the following

$ nix-env -u gcc
warning: name collision in input Nix expressions, skipping '/Users/antkong/.nix-defexpr/channels_root/nixpkgs'

but gcc still points to the one under my nix profile.


The command to use is actually

 nix-env -e gcc 

-u is not uninstall as I thought... It actually means upgrade.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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