I had installed it via curl https://nixos.org/nix/install | sh, and got the error then, and also after uninstalling with rm -rf /nix and reinstalling with yay -a nix archlinux-nix; sudo archlinux-nix bootstrap
16:01:01 ✘ jr@fm ~/hcr ⬡ v8.16.0 🦀 1.33.0-nightly 946-feature-chain-pair ✘ ⬇ ⬆ ✚ ✭
$ sudo archlinux-nix bootstrap
[sudo] password for jr:
Installing sandbox binaries from NixOS-19.09 ...
nix-build: error while loading shared libraries: libboost_context.so.1.69.0: cannot open shared object file: No such file or directory
I found this:
I have boost-libs installed already, running sudo ldconfig didn’t help.
16:25:05 ✘ jr@fm ~/hcr ⬡ v8.16.0 🦀 1.33.0-nightly 946-feature-chain-pair ✘ ⬇ ⬆ ✚ ✭ 2m15s
$ nix-shell
nix-shell: error while loading shared libraries: libboost_context.so.1.69.0: cannot open shared object file: No such file or directory
17:19:20 jr@fm ~ ⬡ v8.16.0
$ nix-env
nix-env: error while loading shared libraries: libboost_context.so.1.69.0: cannot open shared object file: No such file or directory
17:24:56 ✘ jr@fm ~ ⬡ v8.16.0
$ nix-env --version
nix-env: error while loading shared libraries: libboost_context.so.1.69.0: cannot open shared object file: No such file or directory
17:27:21 jr@fm ~ ⬡ v8.16.0 21s
$ echo $NIX_PATH
nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixpkgs:/nix/var/nix/profiles/per-user/root/channels:/home/jr/.nix-defexpr/channels
As shown above, there are multiple commands that fail with this error: nix-shell, nix-env. In my context, I want to run nix-shell https://holochain.love, but that also produces the same error as just running nix-shell.
As mentioned I got the same error from installing from curl https://nixos.org/nix/install | sh before uninstalling that and reinstalling from the package manager.
I don’t actually have a store directory under /nix/. Hmm. All I have is /nix/var/nix/profiles/arch-system which is empty. Before switching back to trying to install from curl I tried installing manually as per Nix - ArchWiki but got this on the first command:
06:27:34 ✘ jr@fm ~/hcr ⬡ v8.16.0 🦀 1.33.0-nightly 946-feature-chain-pair ✘ ⬇ ⬆ ✚ ✭
$ sudo chown -R $USER. /nix/var/nix/{gcroots,profiles}
[sudo] password for jr:
Sorry, try again.
[sudo] password for jr:
chown: cannot access '/nix/var/nix/gcroots': No such file or directory
Maybe gcroots is specific to Archlinux and not Manjaro. So continuing:
06:34:36 jr@fm ~ ⬡ v8.16.0
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel: error while loading shared libraries: libboost_context.so.1.69.0: cannot open shared object file: No such file or directory
06:34:46 ✘ jr@fm ~ ⬡ v8.16.0
$ nix-channel --update
nix-channel: error while loading shared libraries: libboost_context.so.1.69.0: cannot open shared object file: No such file or directory
06:34:50 ✘ jr@fm ~ ⬡ v8.16.0
$ nix-env -u
nix-env: error while loading shared libraries: libboost_context.so.1.69.0: cannot open shared object file: No such file or directory
06:34:54 ✘ jr@fm ~ ⬡ v8.16.0
$ sudo nix-channel --update
[sudo] password for jr:
nix-channel: error while loading shared libraries: libboost_context.so.1.69.0: cannot open shared object file: No such file or directory
06:35:02 ✘ jr@fm ~ ⬡ v8.16.0
$
I’ll try uninstalling again and reinstalling from curl. Failing that I will try installing a fresh Manjaro, and then another distro, Nix should work better.
Strange, I uninstalled and reinstalled with curl https://nixos.org/nix/install | sh and now it works albeit two warnings:
06:35:02 ✘ jr@fm ~ ⬡ v8.16.0
$ sudo rm -rf /nix
06:36:47 jr@fm ~ ⬡ v8.16.0
$ curl https://nixos.org/nix/install | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2399 100 2399 0 0 2004 0 0:00:01 0:00:01 --:--:-- 2004
downloading Nix 2.3.1 binary tarball for x86_64-linux from 'https://nixos.org/releases/nix/nix-2.3.1/nix-2.3.1-x86_64-linux.tar.xz' to '/tmp/nix-binary-tarball-unpack.kZhMlIeOW0'...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 15.2M 100 15.2M 0 0 1862k 0 0:00:08 0:00:08 --:--:-- 2552k
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 jr /nix' using sudo
copying Nix to /nix/store................................
installing 'nix-2.3.1'
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
building '/nix/store/cb6ss4jv8baxkq2pi6fnviqp9zyna73l-user-environment.drv'...
created 6 symlinks in user environment
unpacking channels...
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
created 1 symlinks in user environment
Installation finished! To ensure that the necessary environment
variables are set, either log in again, or type
. /home/jr/.nix-profile/etc/profile.d/nix.sh
in your shell.
06:37:28 jr@fm ~ ⬡ v8.16.0 18s
$ . /home/jr/.nix-profile/etc/profile.d/nix.sh
06:37:58 jr@fm ~/hcr ⬡ v8.16.0 🦀 1.33.0-nightly 946-feature-chain-pair ✘ ⬇ ⬆ ✚ ✭
$ nh
unpacking 'https://holochain.love'...
unpacking 'https://github.com/NixOS/nixpkgs/archive/821c7ed030bca86c8217e6d20df1f01c6474adf4.tar.gz'...
unpacking 'https://github.com/mozilla/nixpkgs-mozilla/tarball/200cf0640fd8fdff0e1a342db98c9e31e6f13cd7'...
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixpkgs' does not exist, ignoring
these derivations will be built:
/nix/store/0g0yrlygc5fvxhb9ya8sv2v6djnvvv7s-hn-dist-audit.drv
#snip
I tried to fix as per a suggestion here but still got the warnings:
we also had an outage with the nix database. May be contributing to your issue.
Nix doesn’t reference /usr/lib or any shared directory, it will only reference store paths. So it doesn’t really care what other versions of boosts are installed. The version/derivation is determined at evaluation time of the expression.