NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.54k stars 1.5k forks source link

Feature request for uninstaller #2509

Open coretemp opened 5 years ago

coretemp commented 5 years ago

People have been enthusiastic in writing various installers, but no well written uninstaller has been written. I also wrote various low quality versions of this based on comments like "delete the folowing directories"/"delete the nixbuild users, etc." that on a superficial level seem to work, but life would be much easier for a lot of people if a command would be made available that would really remove nix.

The preferred interface for such an uninstaller is to simply pass --uninstall to the installer. I am not so much interested in discussion of the specific interface as long as it becomes possible to uninstall nix and then reinstall nix on a variety of platforms (CentOS/Debian/Ubuntu/macOS).

I also don't understand the reason for choosing to document how to uninstall as opposed to automation. Not providing an uninstaller provides a breeding ground for FUD making people scared to try out Nix (I have seen that over and over).

To make it credible that it actually works, the installer and uninstaller would have to be tested as part of standard release procedures.

edolstra commented 5 years ago

Maybe add a nix uninstall-nix command that nukes /nix, the build users etc.? Seems better than having it as an installer flag since you might not have the installer anymore.

coretemp commented 5 years ago

The way I would like to see it implemented is something that doesn't depend on a lot of things working. So, there would be a nix wrapper and that nix wrapper would run the more complex C++ binary (that can break for libraries not working or whatever). One of the options in the nix wrapper would be the uninstall-nix flag. This way, no matter how awful the system looks or what people did, it still works.

If this is still not reliable enough, you can also add a fallback implementation in the C++ binary. That way I expect it to always work.

As indicated I don't care about the specific details of the implementation as long as it is implemented in such a way that if I do a Google search for "uninstall Nix broken" that there no results for the past three years and I expect that to be completely doable (for example in the way I described above). You could also just start with implementing just the C++ version, since I expect that's what you would prefer and optimistically would believe to already achieve that goal (I do not share that vision).

ghost commented 5 years ago

Relates to https://github.com/NixOS/nix/issues/1608

expelledboy commented 5 years ago

I had a crack at doing one for OSx.

uri-canva commented 4 years ago

This is even more useful / important now that with catalina a volume is required.

cc @LnL7

PandaWhisperer commented 4 years ago

Just dropped by looking for this. Wanted to try out Nix and basically messed up everything right away. I was looking for a way to nuke my installation and start over, but, not only is there no uninstaller, there is not even a section in the manual that describes how to manually uninstall it.

At least the installer lists the steps required to remove the APFS volume... but that's it. Doesn't explain how to do anything else. I referred to @expelledboy's script for other steps to run, but at least half of those didn't apply to me because I did the single user installation, not multi-user.

expelledboy commented 4 years ago

At least the installer lists the steps required to remove the APFS volume... but that's it. Doesn't explain how to do anything else. I referred to @expelledboy's script for other steps to run, but at least half of those didn't apply to me because I did the single user installation, not multi-user.

@PandaWhisperer The single user uninstall is much more simple, as it doesnt try and replace files in your environment. If you look at the script it actually does a single user cleanup first, and then removes other files installed into your environment by the daemon installer.

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

nixos-discourse commented 3 years ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/anyone-up-for-picking-at-some-nix-onboarding-improvements/13152/6

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info