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"). download-using-manifests.pl: perl: warning: Setting locale failed. download-using-manifests.pl: perl: warning: Please check that your locale settings: download-using-manifests.pl: LANGUAGE= (unset), download-using-manifests.pl: LC_ALL = (unset), download-using-manifests.pl: LANG = "en_US.UTF-8" download-using-manifests.pl: are supported and installed on your system. download-using-manifests.pl: perl: warning: Falling back to the standard locale ("C"). download-from-binary-cache.pl: perl: warning: Setting locale failed. download-from-binary-cache.pl: perl: warning: Please check that your locale settings: download-from-binary-cache.pl: LANGUAGE= (unset), download-from-binary-cache.pl: LC_ALL = (unset), download-from-binary-cache.pl: LANG = "en_US.UTF-8"
[...]
fetching path ‘/nix/store/6mk1s81va81dl4jfbhww86cwkl4gyf4j-stdenv’... 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").
*** Downloading ‘https://cache.nixos.org/nar/0aznfg1g17a8jdzvnp3pqszs9rq2wiwf2rcgczyg5b3k6d0iricl.nar.xz’ to ‘/nix/store/6mk1s81va81dl4jfbhww86cwkl4gyf4j-stdenv’... % Total % Received % Xferd Average Speed TimeTimeTimeCurrent Dload Upload Total Spent Left Speed 1008324100832400635300:00:010:00:01--:--:-- 6373
[nix-shell:~]$
检查GCC版本:
1 2 3 4 5 6 7 8 9 10
[nix-shell:~]$ gcc -v Using built-in specs. COLLECT_GCC=/nix/store/dyj2k6ch35r1ips4vr97md2i0yvl4r5c-gcc-5.4.0/bin/gcc COLLECT_LTO_WRAPPER=/nix/store/dyj2k6ch35r1ips4vr97md2i0yvl4r5c-gcc-5.4.0/libexec/gcc/x86_64-unknown-linux-gnu/5.4.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: Thread model: posix gcc version 5.4.0 (GCC)
现在,继续并测试代码。完成后,输入 exit 返回到控制台。
1 2 3
[nix-shell:~]$ exit exit
一旦你从 nix-shell 中退出,你就不能使用 GCC。
这是另一个例子。
1 2
$ nix-shell -p hello
这会构建或下载 GNU Hello 和它的依赖关系,然后将其放入 hello 命令所在的 Bash shell 中,所有这些都不会影响你的正常环境: