-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
How to remove nix #1402
Comments
To uninstall nix you will need to do the following things:
|
Thank you |
no offical uninstaller? |
I find a new way, install again and installer will tell you how to remove it, all included but deleting user. |
Hi there, I've completed the third step (sudo -fr/nix) How does one go about these first two steps on OSX, is this from within the terminal? I can't seem to find the .profile or .bash_profile
remove the . "$HOME/.nix-profile/etc/profile.d/nix.sh" line in your ~/.profile or ~/.bash_profile rm -rf $HOME/{.nix-channels,.nix-defexpr,.nix-profile,.config/nixpkgs} sudo rm -rf /nix |
@pynixwang This didn't work for me under macOS. What command did you run to see the uninstall options? |
I followed @zimbatm's instructions, with some tweaks:
But I found one important piece was missing, and which the nix installer did not detect upon reinstallation: there was a lingering sudo launchctl unload -w /Library/LaunchDaemons/org.nixos.nix-daemon.plist
sudo launchctl load -w /Library/LaunchDaemons/org.nixos.nix-daemon.plist Perhaps better would have been to remove and unload the launchdaemon as part of uninstalling. |
As I'm sure people know, none of these instructions clean up the large set of users created.. |
Yeah, the instructions of upgrading Nix tell just to repeat curl |sh. Then instructions in install script find earlier NIX installation remnants and ask you to delete /nix, profiles etc with only rm -rf But those instructions don't mention:
|
Or for macOS:
|
@mbaltaks |
I had a crack at writing a complete uninstall script for OSx. Hope someone finds this useful. |
Hey @expelledboy, your script contains the following code: if [ -L $HOME/Applications ]; then
rm $HOME/Applications
fi I might be wrong, but that doesn't look safe to me. |
@zimbatm's solution always worked for me, except for the
This is with nix@2.3.6. Update: I unmounted the
An official uninstall script would've been super helpful. Update 2: After mounting the |
Why? I am removing a link. Perhaps I could have checked if the link was generated by nix. |
It just looks scary to run a script written by someone on the Internet that has a line that contains both "rm" and "$HOME/Applications". I'm sure that a seasoned programmer would immediately figure out if that's a malicious line or not, but others (including me) didn't. Maybe worth it to add an explanatory comment above that code block :) |
@sambacha Your instructions reference The uninstall instructions for macOS are printed during the install. Currently they are echo " 1. Remove the entry from fstab using 'sudo vifs'"
echo " 2. Destroy the data volume using 'diskutil apfs deleteVolume'"
echo " 3. Remove the 'nix' line from /etc/synthetic.conf or the file" though this will change slightly with #4181. |
My instructions reference ~/nix because of the contents listed in that directory that may persist depending on how nix is removed. It could be any directory where the end user decided to install ~nix, I included it as a reference not as a definitive how to guide, just so that it may spare someone more time from searching for additional help perhaps. Excited to see some updates for Nix , thanks for letting me know as well, cheers |
On Big Sur, M1 mac, I have tried removing the Does anyone know how to remove this or proper nix uninstall directions for Catalina and after? |
You probably have to edit |
Ah, thank you @lilyball. Same time you posted I just found this very helpful guide for post Mojave uinstalls: https://gist.github.com/chriselsner/3ebe962a4c4bd1f14d39897fc5619732 |
Would like to add that environment variables, on my system, were also set in |
To remove grep nixbld /etc/passwd | awk -F ":" '{print $1}' > /tmp/nixusers
cat /tmp/nixusers | xargs -t -n 1 sudo userdel -r |
If you're coming here from Google, official documentation for uninstalling nix is available here: https://nixos.org/manual/nix/stable/installation/installing-binary.html#uninstalling |
The "official" uninstalling instructions are inaccurate. Like right now, they're suggesting to delete these ones:
... whereas on my system I found also /etc/profile.d/nix.sh Also there's a whole bunch of nixbld* users were created during install:
and group:
|
I tried to delete /nix from my macbook but its telling me its read only and wont let me |
If you have not yet, see: https://nixos.org/manual/nix/unstable/installation/uninstall.html |
That worked for me, thanks for helping :) |
Hi,
I am using nix on Ubuntu 16. I installed nix by these commands:
bash <(curl https://nixos.org/nix/install)
source ~/.nix-profile/etc/profile.d/nix.sh
I have not started nix-daemon. Or I did not use any extra command...
I will not remove the nix package manager now. But If I should remove it, what should I type on command line? Is there any ready script or something?
I found this topic: #458 But it is not completely clear about uninstallation. Because there is not only /nix folder. There are link files on HOME + nix has set some directories to PATH variable?
How can I make sure that I remove it completely?
Thank you
The text was updated successfully, but these errors were encountered: