ビルダー プロセスのクローン作成: Nix (Linux 下) 更新チャネルを使用している場合、操作は許可されません

ビルダー プロセスのクローン作成: Nix (Linux 下) 更新チャネルを使用している場合、操作は許可されません

私は Arch Linux を使用しています4.19.15-1-lts #1 SMP Sun Jan 13 13:53:52 CET 2019 x86_64 GNU/Linux。Nix もインストールしています: nix-env (Nix) 2.2

最近のバージョンへのアップデートまでは、問題は一度もありませんでした2.2。私は常に次の 2 つの手順でアップグレード/アップデートを実行します。

$ nix-channel --update
...
$ nix-env --upgrade
...

...しかし、最近の2.2アップデート後、動作させる方法が見つかりませんnix-channel --update。常に次のエラーが発生します:

error: cloning builder process: Operation not permitted
error: unable to start build process
error: program '/nix/store/876x7a35qbn3q062b6zcz6va88m0990d-nix-2.2/bin/nix-env' failed with exit code 1

...以前の操作をロールバックした場合でも、次のようになります。

$ nix-channel --update 
unpacking channels...
error: cloning builder process: Operation not permitted
error: unable to start build process
error: program '/nix/store/876x7a35qbn3q062b6zcz6va88m0990d-nix-2.2/bin/nix-env' failed with exit code 1
$ nix-channel --rollback 
switching from generation 40 to 39
$ nix-channel --update 
unpacking channels...
error: cloning builder process: Operation not permitted
error: unable to start build process
error: program '/nix/store/876x7a35qbn3q062b6zcz6va88m0990d-nix-2.2/bin/nix-env' failed with exit code 1

更新リストには次の内容が含まれています:

$ nix-channel --list 
nixpkgs https://nixos.org/channels/nixpkgs-unstable

...そして結局、それを削除することさえできなくなりました:

$ nix-channel --remove nixpkgs 
uninstalling 'nixpkgs-19.03pre165281.7d864c6bd63'
error: cloning builder process: Operation not permitted
error: unable to start build process
error: program '/nix/store/876x7a35qbn3q062b6zcz6va88m0990d-nix-2.2/bin/nix-env' failed with exit code 1

再インストールは避けたいです。


アップデート

待ちきれなかったよ!O:)

先に進み、現在のインストールを削除しました...そして、新規インストールを実行すると、基本的に同じ結果が得られました。

$ sh <(curl https://nixos.org/nix/install) --no-daemon 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2476  100  2476    0     0   5417      0 --:--:-- --:--:-- --:--:--  5406
downloading Nix 2.2.1 binary tarball for x86_64-linux from 'https://nixos.org/releases/nix/nix-2.2.1/nix-2.2.1-x86_64-linux.tar.bz2' to '/tmp/nix-binary-tarball-unpack.n5vqvsi4Uq'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 22.5M  100 22.5M    0     0  4016k      0  0:00:05  0:00:05 --:--:-- 4377k
Note: a multi-user installation is possible. See https://nixos.org/nix/manual/#sect-multi-user-installation
performing a single-user installation of Nix...
directory /nix does not exist; creating it by running 'mkdir -m 0755 /nix && chown x80486 /nix' using sudo
[sudo] password for x80486: 
copying Nix to /nix/store.................................
initialising Nix database...
Nix: creating /home/x80486/.nix-profile
installing 'nix-2.2.1'
error: cloning builder process: Operation not permitted
error: unable to start build process
/tmp/nix-binary-tarball-unpack.n5vqvsi4Uq/unpack/nix-2.2.1-x86_64-linux/install: unable to install Nix into your default profile

...つまり、一般的には、Linux (または具体的には使用するディストリビューション) と Nix で何かが起こっているようです。

答え1

の提案に従ってこのコメント問題を解決します:

sysctl kernel.unprivileged_userns_clone=1

答え2

Nixはクローンにかなり多くのフラグを使用します主にLinuxの名前空間を切り離すためです。あなたのシステムはこれらのいくつかをサポートしていないと思います。特権のないプロセス。私の記憶が正しければ、一部のディストリビューションはセキュリティ上の懸念からこれを選択しました。

関連情報