按照说明安装后
curl https://nixos.org/nix/install | sh
Run Code Online (Sandbox Code Playgroud)
并且未找到注销/登录、nix-env 和 nix-build。我遇到了 debian stretch 的问题,现在使用了 buster。我究竟做错了什么?
nix手册指示执行
source ~/.nix-profile/etc/profile.d/nix.sh
Run Code Online (Sandbox Code Playgroud)
但执行后打印的指令说要做(我不记得了)
./~/.nix-profile/etc/profile.d/nix.sh
Run Code Online (Sandbox Code Playgroud)
并将相同的命令插入到~/.profile. 这个问题的原因是之间的差异.和source(见https://superuser.com/questions/46139/what-does-source-do)。该脚本正在环境中设置 $PATH 变量,并具有所需的效果,source但没有效果.(在其自己的 shell 中运行并在最后关闭它)。
解决方法:将.profile(或更好地将其移至.bashrc)中的行更改为
if [ -e /home/xxx/.nix-profile/etc/profile.d/nix.sh ]; then source /home/xxx/.nix-profile/etc/profile.d/nix.sh; fi
Run Code Online (Sandbox Code Playgroud)
(xxx是您的用户名),
| 归档时间: |
|
| 查看次数: |
3730 次 |
| 最近记录: |