首页 > 解决方案 > 安装后找不到 nix-env 和 nix-build (debian buster)

问题描述

安装后按照说明

curl https://nixos.org/nix/install | sh

并且未找到注销/登录、nix-env 和 nix-build。我遇到了 debian 拉伸问题,现在遇到了 buster 问题。我究竟做错了什么?

标签: nix

解决方案


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是您的用户名),


推荐阅读