-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Nix install script instructions for removing old Nix version may need to include /Library/LaunchDaemons/org.nixos.nix-daemon.plist in deletion list #4860
Comments
The currently-released installer ~should have printed a first step directing you to remove the plist before the instructions you describe--but only if the file exists.
This check is fairly straightforward, so I'm skeptical that it wouldn't have printed if the file was present. Can you confirm whether the instruction printed on the initial run? If you ran the installer again after removing the plist, the instruction wouldn't show. (The current installer does have some unfortunate gotcha conditions--it's possible to run the installer, hit a failure, remove the files that caused the failure, and re-run only to have it fail again because of files it added before the previous failure. I have a thread open on discourse (https://discourse.nixos.org/t/anyone-up-for-picking-at-some-nix-onboarding-improvements/13152) fishing for help with a project that would ~fix this problem, but no bites so far.) I spot-checked the behavior of the check that gates this and don't see anything unexpected. If you can verify it wasn't present, we may need your help investigating the behavior of |
I suspect this may have been what happened. I ran the installer several times and it failed b/c I didn't restore the old bashrc and zshrc properly. Once I did that, the next error was the one I reported above. Then after fixing all three errors, the install completed successfully without further error. If it looks ok to you then it probably is. Though, is there any downside to including that plist file in the |
No good reason :) Fixing this problem (both by adding an The existing behavior mainly comes down to how the Linux and macOS-specific installer variants work (and how difficult working on the installer has been, historically--but that situation improved a lot in March). There's a core script, with platform-specific functions in each platform-specific script. They get their chance to list all platform uninstall steps before the general steps. |
Thanks. As I said, it's a minor issue, and the error messages were sufficient to figure it out. Not a high priority, just wanted to report it as the installer instructed. |
Describe the bug
This is a minor issue. When installing Nix on a Mac (Mojave 10.14.6 in this case) with a prior version of Nix, the Nix install script requires you first delete the old installation. It provides instructions for doing this:
sudo rm -rf /etc/nix /nix /var/root/.nix-profile /var/root/.nix-defexpr /var/root/.nix-channels /Users/byron/.nix-profile /Users/byron/.nix-defexpr /Users/byron/.nix-channels
Step #3 is incomplete, and the install will still fail if you don't also delete the file
/Library/LaunchDaemons/org.nixos.nix-daemon.plist
. The error it gives if you haven't deleted that file is:---- sudo execution ------------------------------------------------------------
I am executing:
to set up the nix-daemon as a LaunchDaemon
cp: /Library/LaunchDaemons/org.nixos.nix-daemon.plist and /nix/var/nix/profiles/default/Library/LaunchDaemons/org.nixos.nix-daemon.plist are identical (not copied).
---- 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.
If you can, open an issue at https://github.com/nixos/nix/issues
Or feel free to contact the team,
Steps To Reproduce
run
sh install-nix-2.3.11 --daemon
on a Mac without having first deleted/Library/LaunchDaemons/org.nixos.nix-daemon.plist
.Expected behavior
Expected behavior is for the install script to finish without error.
nix-env --version
outputnix-env (Nix) 2.3.11
Additional context
Nix install script directions for removing an old Nix version:
---- oh no! --------------------------------------------------------------------
There are some relics of a previous installation of Nix at /nix, and
this scripts assumes Nix is not yet installed. Please delete the old
Nix installation and start again.
Uninstalling nix:
sudo mv /etc/bashrc.backup-before-nix /etc/bashrc
(after this one, you may need to re-open any terminals that were
opened while it existed.)
sudo mv /etc/zshrc.backup-before-nix /etc/zshrc
(after this one, you may need to re-open any terminals that were
opened while it existed.)
sudo rm -rf /etc/nix /nix /var/root/.nix-profile /var/root/.nix-defexpr /var/root/.nix-channels /Users/me/.nix-profile /Users/me/.nix-defexpr /Users/me/.nix-channels
and that is it.
The text was updated successfully, but these errors were encountered: