Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

couldn't install nix on top of broken nix #5703

Closed
christopherlam opened this issue Dec 1, 2021 · 3 comments
Closed

couldn't install nix on top of broken nix #5703

christopherlam opened this issue Dec 1, 2021 · 3 comments
Labels

Comments

@christopherlam
Copy link

Describe the bug

Could not install nix on top of existing broken nix store.

Steps To Reproduce

Cannot recall exact steps: installed nix on top of ubuntu, installed home-manager. Set up home-manager. Somewhere in the home-manager manual suggests nix-env --uninstall '*' to clean up nix paths. I do this which uninstalls packages and nix and home-manager. Uh oh. No more nix. I call sh <(curl -L https://nixos.org/nix/install) --daemon to install nix again which leads to the failure as follows

Expected behavior

Nix installs successfully

Additional context


usermod: no changes
              Note:	Nix build user 28
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld29

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo useradd --home-dir /var/empty --comment Nix build user 29 --gid 30000 --groups nixbld --no-user-group --system --shell /sbin/nologin --uid 30029 --password ! nixbld29

Creating the Nix build user, nixbld29

           Created:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo usermod --comment Nix build user 29 nixbld29

in order to give nixbld29 a useful comment

usermod: no changes
              Note:	Nix build user 29
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld30

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo useradd --home-dir /var/empty --comment Nix build user 30 --gid 30000 --groups nixbld --no-user-group --system --shell /sbin/nologin --uid 30030 --password ! nixbld30

Creating the Nix build user, nixbld30

           Created:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo usermod --comment Nix build user 30 nixbld30

in order to give nixbld30 a useful comment

usermod: no changes
              Note:	Nix build user 30
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld31

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo useradd --home-dir /var/empty --comment Nix build user 31 --gid 30000 --groups nixbld --no-user-group --system --shell /sbin/nologin --uid 30031 --password ! nixbld31

Creating the Nix build user, nixbld31

           Created:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo usermod --comment Nix build user 31 nixbld31

in order to give nixbld31 a useful comment

usermod: no changes
              Note:	Nix build user 31
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the build user nixbld32

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo useradd --home-dir /var/empty --comment Nix build user 32 --gid 30000 --groups nixbld --no-user-group --system --shell /sbin/nologin --uid 30032 --password ! nixbld32

Creating the Nix build user, nixbld32

           Created:	Yes
            Hidden:	Yes
    Home Directory:	/var/empty

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo usermod --comment Nix build user 32 nixbld32

in order to give nixbld32 a useful comment

usermod: no changes
              Note:	Nix build user 32
   Logins Disabled:	Yes
  Member of nixbld:	Yes
    PrimaryGroupID:	30000

~~> Setting up the basic directory structure

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo /bin/chown -R root:nixbld /nix

to take root ownership of existing Nix store files


---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo install -dv -m 0755 /nix /nix/var /nix/var/log /nix/var/log/nix /nix/var/log/nix/drvs /nix/var/nix /nix/var/nix/db /nix/var/nix/gcroots /nix/var/nix/profiles /nix/var/nix/temproots /nix/var/nix/userpool /nix/var/nix/gcroots/per-user /nix/var/nix/profiles/per-user

to make the basic directory structure of Nix (part 1)

install: creating directory '/nix/var/nix/userpool'

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo install -dv -g nixbld -m 1775 /nix/store

to make the basic directory structure of Nix (part 2)


---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo install -dv -m 0555 /etc/nix

to place the default nix daemon configuration (part 1)

install: creating directory '/etc/nix'

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo install -m 0664 /tmp/tmp.HYAxilCSSm/.nix-channels /root/.nix-channels

to set up the default system channel (part 1)


~~> Installing Nix

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo cp -RLp ./store/10jzrky6qp59qm75zwxxjysyzphywznj-openssl-1.1.1l-bin ./store/1c1r48qa0m23vr9jy8sm0dc04vv14dak-coreutils-8.32 ./store/1kw32h97j6bbqcb2kl2nnaw57xnwyvcb-zstd-1.4.9 ./store/21iicqw6ib82qa1f1gfgppijz7sck8xj-aws-c-io-0.9.1 ./store/23wq9xncqncvxyddqpcb57f1qkgywdrr-aws-c-event-stream-0.2.7 ./store/433q5vd1ag3lg6chrm7pkqc78536l7pr-sqlite-3.35.5 ./store/4frnjf7jr2cc5k5wfqjapvszanmc8nq9-openssl-1.1.1l ./store/50msfhkz5wbyk8i78pjv3y9lxdrp7dlm-gcc-10.3.0-lib ./store/5d821pjgzb90lw4zbg6xwxs7llm335wr-libunistring-0.9.10 ./store/5p4jga61v4mg9pdrglj2hj76y5rbz02k-busybox-static-x86_64-unknown-linux-musl-1.32.1 ./store/5q2fwg0hhaw6n9j50snd6bn7r5rqr8y9-attr-2.4.48 ./store/5r0a92rsppim1dljzr0rhpxwdsmnab9l-libssh2-1.9.0 ./store/7lv2ahpd0x6zknyalr55mar2il2a3v0k-libsodium-1.0.18 ./store/7v7acyh2s8z2sajc1sijjs7a0svlwbyx-brotli-1.0.9-lib ./store/9pxjmchn68d0l78pcq3r54xdgaxpl83j-s2n-tls-1.0.0 ./store/ckb0qa2yrxrpp0piffgjq9id38gc5z9v-libidn2-2.3.1 ./store/dp18s34dnzbllx16cyb2pwz0fm19nbnf-bzip2-1.0.6.0.2 ./store/ds491f6b5pdk3xxnc2w103asyz1y4cfc-zlib-1.2.11 ./store/dvcalma5h3wd8bbwhj7g9m3yswxm707c-nss-cacert-3.66 ./store/fvb3znd0x7ijk0bqg3m1rndbzpspamrg-keyutils-1.6.3-lib ./store/hapw7q1fkjxvprnkcgw9ppczavg4daj2-nix-2.4 ./store/hh5ai1v2hhizkv5n4fr4hg72l1a5z1iw-curl-7.76.1 ./store/hi3dzzq1i54cpv259srcr99vh6lc4a65-openssl-1.1.1l-dev ./store/iz2jmn57crmp45y19bsj73bckj331jkq-xz-5.2.5 ./store/jbrdvdbanx81n7h4ij53mnb6v5qrc4h7-aws-checksums-0.1.11 ./store/jsfa5dnrrp1cl7yxkq8smgygg9fysgvk-aws-sdk-cpp-1.8.121 ./store/jsp3h3wpzc842j0rz61m5ly71ak6qgdn-glibc-2.32-54 ./store/l3hn1rpl7m5x45x1733x4n6wgdmn9pz0-editline-1.17.1 ./store/l4vm4han6vnnijhb6icmybbskq73ymj0-libxml2-2.9.12 ./store/lbc8s09msihzfrdfbsb7m3660hs05igp-libkrb5-1.18 ./store/mrv4y369nw6hg4pw8d9p9bfdxj9pjw0x-acl-2.3.0 ./store/n5vm0iv9jsxl0jbh8wh9l0sy8lb55z01-libarchive-3.5.2-lib ./store/n9va4cqy8r026jcjkxbnzhqbd33kl3nm-nghttp2-1.43.0-lib ./store/rsf0p5xifn2n5smg5v3l1sz75sv0maz2-libcpuid-0.5.1 ./store/vaal5xhgdn20qgjj58p9kdnqam8ppn6y-perl-5.32.1 ./store/w2wh0vxwk48fcdli04a38b4inbrj2qpz-aws-c-cal-0.4.5 ./store/wdja1fn6ldqzfy7ra9f072q34249dnd5-libseccomp-2.5.1-lib ./store/wv35g5lff84rray15zlzarcqi9fxzz84-bash-4.4-p23 ./store/yicaw4ql8dz3bvrpw1swxn3xwvr0afk3-aws-c-common-0.5.5 ./store/zr1jbxmlh4065a0njbhf471rk1xp9hxg-boehm-gc-8.0.4 /nix/store/

to copy the basic Nix files to the new store at /nix/store

cp: cannot overwrite non-directory '/nix/store/50msfhkz5wbyk8i78pjv3y9lxdrp7dlm-gcc-10.3.0-lib/lib64' with directory './store/50msfhkz5wbyk8i78pjv3y9lxdrp7dlm-gcc-10.3.0-lib/lib64'
cp: cannot overwrite non-directory '/nix/store/jsp3h3wpzc842j0rz61m5ly71ak6qgdn-glibc-2.32-54/lib64' with directory './store/jsp3h3wpzc842j0rz61m5ly71ak6qgdn-glibc-2.32-54/lib64'
cp: cannot overwrite non-directory '/nix/store/lbc8s09msihzfrdfbsb7m3660hs05igp-libkrb5-1.18/sbin' with directory './store/lbc8s09msihzfrdfbsb7m3660hs05igp-libkrb5-1.18/sbin'

---- oh no! --------------------------------------------------------------------
Jeeze, something went wrong. If you can take all the output and open
an issue, we'd love to fix the problem so nobody else has this issue.

:(

We'd love to help if you need it.

You can open an issue at https://github.com/nixos/nix/issues

Or feel free to contact the team:
 - Matrix: #nix:nixos.org
 - IRC: in #nixos on irc.libera.chat
 - twitter: @nixos_org
 - forum: https://discourse.nixos.org
@zot
Copy link

zot commented Mar 25, 2022

I deleted /nix and I was able to install it

@stale stale bot added the stale label Oct 30, 2022
@iFreilicht
Copy link
Contributor

iFreilicht commented Jan 31, 2023

This issue can most likely be closed. The solution by @zot should work, and the installer was already updated so this specific problem cannot occur anymore in bb0c4b9.

@christopherlam
Copy link
Author

Ok :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants