Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uninstall Nix

Tags:

nix

I've installed Nix into an Ubuntu WSL installation. I now want to uninstall it.

The manual states to simply "rm -rf /nix".

Nix adds itself to $PATH and the manual makes mention of a Nix daemon.

Surely there are other parts of my system that Nix has added itself to.

For one, I can see an entry in ~/.profile which is sourcing ~/.nix-profile/etc/profile.d/nix.sh

Is there anything else that needs to be done?

like image 726
Rebs Avatar asked Aug 20 '18 11:08

Rebs


People also ask

How do I reinstall nix?

Installation. To install Nix, run curl -L https://nixos.org/nix/install | sh as a non-root user and follow the instructions. Alternatively, you may prefer to download the installation script and verify its integrity using GPG signatures. Instructions for doing so can be found here: https://nixos.org/nix/download.html.

How do I remove a package from nix?

To uninstall a package, remove it from the pkg list in the configuration. nix file: environment. systemPackages = with pkgs; [ wget vim nano zsh file ];

What is nix shell?

Description. The command nix-shell will build the dependencies of the specified derivation, but not the derivation itself. It will then start an interactive shell in which all environment variables defined by the derivation path have been set to their corresponding values, and the script $stdenv/setup has been sourced.


1 Answers

NOTE: This answer is about uninstalling Nix from a Linux or Linux-like system in 2018. Since then, Nix has started to support systemd unit installations and since Catalina, macOS installations have become more complex too. This answer is not official documentation.

The "curl | sh" installer for Nix on Linux does not install the Nix daemon, so the only things to delete are /nix, the line in ~/.profile and ~/.nix-profile.

like image 73
Robert Hensing Avatar answered Oct 15 '22 20:10

Robert Hensing