2014-08-27 16:41:09 +00:00
|
|
|
|
<chapter xmlns="http://docbook.org/ns/docbook"
|
|
|
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
|
|
xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
|
|
|
version="5.0"
|
|
|
|
|
xml:id="ch-installing-binary">
|
|
|
|
|
|
|
|
|
|
<title>Installing a Binary Distribution</title>
|
|
|
|
|
|
2017-07-30 10:26:17 +00:00
|
|
|
|
<para>If you are using Linux or macOS, the easiest way to install
|
2014-11-24 14:34:17 +00:00
|
|
|
|
Nix is to run the following command:
|
2014-08-27 16:41:09 +00:00
|
|
|
|
|
|
|
|
|
<screen>
|
|
|
|
|
$ bash <(curl https://nixos.org/nix/install)
|
|
|
|
|
</screen>
|
|
|
|
|
|
|
|
|
|
This will perform a single-user installation of Nix, meaning that
|
|
|
|
|
<filename>/nix</filename> is owned by the invoking user. You should
|
|
|
|
|
run this under your usual user account, <emphasis>not</emphasis> as
|
|
|
|
|
root. The script will invoke <command>sudo</command> to create
|
|
|
|
|
<filename>/nix</filename> if it doesn’t already exist. If you don’t
|
|
|
|
|
have <command>sudo</command>, you should manually create
|
2014-11-24 14:34:17 +00:00
|
|
|
|
<command>/nix</command> first as root, e.g.:
|
2014-08-27 16:41:09 +00:00
|
|
|
|
|
|
|
|
|
<screen>
|
|
|
|
|
$ mkdir /nix
|
|
|
|
|
$ chown alice /nix
|
|
|
|
|
</screen>
|
|
|
|
|
|
2016-11-03 17:02:29 +00:00
|
|
|
|
The install script will modify the first writable file from amongst
|
|
|
|
|
<filename>.bash_profile</filename>, <filename>.bash_login</filename>
|
|
|
|
|
and <filename>.profile</filename> to source
|
|
|
|
|
<filename>~/.nix-profile/etc/profile.d/nix.sh</filename>. You can set
|
|
|
|
|
the <command>NIX_INSTALLER_NO_MODIFY_PROFILE</command> environment
|
|
|
|
|
variable before executing the install script to disable this
|
|
|
|
|
behaviour.
|
|
|
|
|
|
2014-08-27 16:41:09 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
2015-10-05 16:45:35 +00:00
|
|
|
|
<!--
|
2014-08-27 16:41:09 +00:00
|
|
|
|
<para>You can also manually download and install a binary package.
|
|
|
|
|
Binary packages of the latest stable release are available for Fedora,
|
2017-07-30 10:26:17 +00:00
|
|
|
|
Debian, Ubuntu, macOS and various other systems from the <link
|
2014-08-27 16:41:09 +00:00
|
|
|
|
xlink:href="http://nixos.org/nix/download.html">Nix homepage</link>.
|
|
|
|
|
You can also get builds of the latest development release from our
|
|
|
|
|
<link
|
|
|
|
|
xlink:href="http://hydra.nixos.org/job/nix/master/release/latest-finished#tabs-constituents">continuous
|
|
|
|
|
build system</link>.</para>
|
|
|
|
|
|
|
|
|
|
<para>For Fedora, RPM packages are available. These can be installed
|
|
|
|
|
or upgraded using <command>rpm -U</command>. For example,
|
|
|
|
|
|
|
|
|
|
<screen>
|
2014-11-24 14:34:17 +00:00
|
|
|
|
$ rpm -U nix-1.8-1.i386.rpm</screen>
|
2014-08-27 16:41:09 +00:00
|
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>For Debian and Ubuntu, you can download a Deb package and
|
|
|
|
|
install it like this:
|
|
|
|
|
|
|
|
|
|
<screen>
|
2014-11-24 14:34:17 +00:00
|
|
|
|
$ dpkg -i nix_1.8-1_amd64.deb</screen>
|
2014-08-27 16:41:09 +00:00
|
|
|
|
|
|
|
|
|
</para>
|
2016-06-17 13:25:17 +00:00
|
|
|
|
-->
|
2014-08-27 16:41:09 +00:00
|
|
|
|
|
2015-10-05 16:45:35 +00:00
|
|
|
|
<para>You can also download a binary tarball that contains Nix and all
|
|
|
|
|
its dependencies. (This is what the install script at
|
|
|
|
|
<uri>https://nixos.org/nix/install</uri> does automatically.) You
|
|
|
|
|
should unpack it somewhere (e.g. in <filename>/tmp</filename>), and
|
|
|
|
|
then run the script named <command>install</command> inside the binary
|
|
|
|
|
tarball:
|
2014-08-27 16:41:09 +00:00
|
|
|
|
|
|
|
|
|
<screen>
|
|
|
|
|
alice$ cd /tmp
|
2014-11-24 14:34:17 +00:00
|
|
|
|
alice$ tar xfj nix-1.8-x86_64-darwin.tar.bz2
|
|
|
|
|
alice$ cd nix-1.8-x86_64-darwin
|
2014-08-27 16:41:09 +00:00
|
|
|
|
alice$ ./install
|
|
|
|
|
</screen>
|
|
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>Nix can be uninstalled using <command>rpm -e nix</command> or
|
|
|
|
|
<command>dpkg -r nix</command> on RPM- and Dpkg-based systems,
|
|
|
|
|
respectively. After this you should manually remove the Nix store and
|
|
|
|
|
other auxiliary data, if desired:
|
|
|
|
|
|
|
|
|
|
<screen>
|
|
|
|
|
$ rm -rf /nix</screen>
|
|
|
|
|
|
2015-10-05 16:45:35 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>You can uninstall Nix simply by running:
|
|
|
|
|
|
|
|
|
|
<screen>
|
|
|
|
|
$ rm -rf /nix
|
|
|
|
|
</screen>
|
|
|
|
|
|
2014-08-27 16:41:09 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
2014-11-24 14:34:17 +00:00
|
|
|
|
</chapter>
|