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

Cannot overwrite directory errors on M1 Mac Install #6581

Closed
Dave-Lindberg opened this issue May 27, 2022 · 8 comments
Closed

Cannot overwrite directory errors on M1 Mac Install #6581

Dave-Lindberg opened this issue May 27, 2022 · 8 comments
Labels

Comments

@Dave-Lindberg
Copy link

Describe the bug

When running curl -L https://nixos.org/nix/install | sh on a Mac M1 (OS 12.3.1 ), I receive the following output:

~~> Setting up the basic directory structure

~~> Installing Nix
cp: cannot overwrite directory /nix/store/3l83x42cfix2bziry2db6f2shpisnr4i-libkrb5-1.18/sbin with non-directory ./store/3l83x42cfix2bziry2db6f2shpisnr4i-libkrb5-1.18/sbin
cp: cannot overwrite directory /nix/store/65clrki5hh8qyqhmw7f50hzngxylnxsb-apple-framework-IOKit-11.0.0/Library/Frameworks/IOKit.framework/Versions/Current with non-directory ./store/65clrki5hh8qyqhmw7f50hzngxylnxsb-apple-framework-IOKit-11.0.0/Library/Frameworks/IOKit.framework/Versions/Current
cp: cannot overwrite directory /nix/store/65clrki5hh8qyqhmw7f50hzngxylnxsb-apple-framework-IOKit-11.0.0/Library/Frameworks/IOKit.framework/Headers with non-directory ./store/65clrki5hh8qyqhmw7f50hzngxylnxsb-apple-framework-IOKit-11.0.0/Library/Frameworks/IOKit.framework/Headers
cp: cannot overwrite directory /nix/store/65clrki5hh8qyqhmw7f50hzngxylnxsb-apple-framework-IOKit-11.0.0/Library/Frameworks/IOKit.framework/Modules with non-directory ./store/65clrki5hh8qyqhmw7f50hzngxylnxsb-apple-framework-IOKit-11.0.0/Library/Frameworks/IOKit.framework/Modules
cp: cannot overwrite directory /nix/store/hr1g9ndsjllyk9wxiyp2d3jaiclvc34p-apple-framework-Security-11.0.0/Library/Frameworks/Security.framework/Versions/Current with non-directory ./store/hr1g9ndsjllyk9wxiyp2d3jaiclvc34p-apple-framework-Security-11.0.0/Library/Frameworks/Security.framework/Versions/Current
cp: cannot overwrite directory /nix/store/hr1g9ndsjllyk9wxiyp2d3jaiclvc34p-apple-framework-Security-11.0.0/Library/Frameworks/Security.framework/Headers with non-directory ./store/hr1g9ndsjllyk9wxiyp2d3jaiclvc34p-apple-framework-Security-11.0.0/Library/Frameworks/Security.framework/Headers
cp: cannot overwrite directory /nix/store/hr1g9ndsjllyk9wxiyp2d3jaiclvc34p-apple-framework-Security-11.0.0/Library/Frameworks/Security.framework/Modules with non-directory ./store/hr1g9ndsjllyk9wxiyp2d3jaiclvc34p-apple-framework-Security-11.0.0/Library/Frameworks/Security.framework/Modules
cp: cannot overwrite directory /nix/store/m6rz9cz2dd0xh0m2wbbqaf13y1fipcdb-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/Versions/Current with non-directory ./store/m6rz9cz2dd0xh0m2wbbqaf13y1fipcdb-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/Versions/Current
cp: cannot overwrite directory /nix/store/m6rz9cz2dd0xh0m2wbbqaf13y1fipcdb-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/Headers with non-directory ./store/m6rz9cz2dd0xh0m2wbbqaf13y1fipcdb-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/Headers
cp: cannot overwrite directory /nix/store/m6rz9cz2dd0xh0m2wbbqaf13y1fipcdb-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/Modules with non-directory ./store/m6rz9cz2dd0xh0m2wbbqaf13y1fipcdb-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/Modules

Steps To Reproduce

Run curl -L https://nixos.org/nix/install | sh on a Mac M1 (OS 12.3.1 )

nix-env --version output
zsh: command not found: nix-env

@abathur
Copy link
Member

abathur commented May 27, 2022

You'll have to follow the uninstall instructions before reinstalling it:
https://nixos.org/manual/nix/stable/installation/uninstall.html#macos

@Dave-Lindberg
Copy link
Author

Thanks, that works nicely.
:-)

@surmistry
Copy link

You'll have to follow the uninstall instructions before reinstalling it: https://nixos.org/manual/nix/stable/installation/installing-binary.html#macos

Thanks, that also worked nicely for me.
:-)

@milogert
Copy link
Member

I ran into this issue as well, right after I copied my Mac config from one Mac to another (with the Migration Assistant). Could this cause this sort of interaction? I did the full uninstall process and it worked, but it just got me thinking

@abathur
Copy link
Member

abathur commented Oct 11, 2022

@milogert if you saw them while running the installer, it's just caused by a lack of idempotence in the current installer.

There is a separate issue that a few people have reported with migrations: #6078

@shlok
Copy link

shlok commented Jun 28, 2024

https://nix.dev/manual/nix/2.22/installation/uninstall appears to be an up-to-date link on how to uninstall Nix (including on macOS, which worked for me).

@abathur
Copy link
Member

abathur commented Jun 28, 2024

@fricklerhandwerk looks like the old links are currently broken. Is this a permanent move, or a temporary break? (Do I need to go update saved replies?)

@fricklerhandwerk
Copy link
Contributor

It's temporary and should be fixed with NixOS/nixos-homepage#1486

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

6 participants