在 NixOps 安装中,频道似乎已配置,但 NixOps 实际上并不使用它们。因此,nix-channel --update 会创建第一个代,而 nix-channel --rollback 无法起作用,因为没有更早的代可以回退。
下面的方法似乎能成功清除这些信息。
绝对不要在普通的 Nix 或 NixOS 安装上运行这些命令!它们只适用于 NixOps。
rm /nix/var/nix/profiles/per-user/root/channels-1-link
rm /nix/var/nix/profiles/per-user/root/channels
rm ~/.nix-defexpr/channels
nix-collect-garbage -d
从英语翻译·查看原文With a NixOps setup, channels appear to be configured without NixOps actually using them. Consequently, nix-channel --update makes an initial generation, and nix-channel --rollback cannot help because there isn't an earlier generation to return to.
This appears to remove that information successfully.
Never use this with ordinary Nix or NixOS installations! It applies only to NixOps.
rm /nix/var/nix/profiles/per-user/root/channels-1-link
rm /nix/var/nix/profiles/per-user/root/channels
rm ~/.nix-defexpr/channels
nix-collect-garbage -d