nix - 安装后找不到 nix-env 和 nix-build (debian buster)
问题描述
安装后按照说明
curl https://nixos.org/nix/install | sh
并且未找到注销/登录、nix-env 和 nix-build。我遇到了 debian 拉伸问题,现在遇到了 buster 问题。我究竟做错了什么?
解决方案
nix手册指示执行
source ~/.nix-profile/etc/profile.d/nix.sh
但是执行后打印的指令说要做(我不记得确切)
./~/.nix-profile/etc/profile.d/nix.sh
并将相同的命令插入到~/.profile
. .
问题的原因是和之间的差异source
(参见https://superuser.com/questions/46139/what-does-source-do)。该脚本正在环境中设置 $PATH 变量,并且具有所需的效果source
,但没有效果.
(它在自己的外壳中运行并在最后关闭它)。
治愈:将行更改.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
(xxx
是您的用户名),
推荐阅读
- azure - Azure Function 应用程序在 30 分钟后崩溃
- r - 如何更改卡方检验中的自由度
- java - jar 在 nexus 中部署了两次
- dataset - 在 KeyValueTable 中写入键失败
- python-3.x - ValueError:使用 keras 时,层权重形状(3、3、3、64)与提供的权重形状(64、3、3、3)不兼容
- javascript - 如何将变量传递给参数(在函数中)?
- macos - 如何修复因 Catalina 上的程序崩溃而损坏的 Sketch 文件?
- c++ - 为什么 c++ 中类的大小取决于数据成员的公共/私有状态?
- java - 在main方法中从数组中的位置获取元素
- amazon-web-services - 当它在cloudwatch中多次找到相同的单词时,如何从Lambda多次发送SNS电子邮件?