Next: , Up: Installation   [Contents][Index]


2.1 Binary Installation

This section describes how to install Guix on an arbitrary system from a self-contained tarball providing binaries for Guix and for all its dependencies. This is often quicker than installing from source, which is described in the next sections. The only requirement is to have GNU tar and Xz.

Note: We recommend the use of this shell installer script. The script automates the download, installation, and initial configuration steps described below. It should be run as the root user. As root, you can thus run this:

cd /tmp
wget https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh
chmod +x guix-install.sh
./guix-install.sh

If you’re running Debian or a derivative such as Ubuntu, you can instead install the package (it might be a version older than 1.4.0 but you can update it afterwards by running ‘guix pull’):

sudo apt install guix

Likewise on openSUSE:

sudo zypper install guix

When you’re done, see Application Setup for extra configuration you might need, and Getting Started for your first steps!

Installing goes along these lines:

  1. Download the binary tarball from ‘https://ftp.gnu.org/gnu/guix/guix-binary-1.4.0.x86_64-linux.tar.xz’, where x86_64-linux can be replaced with i686-linux for an i686 (32-bits) machine already running the kernel Linux, and so on (see GNU Distribution).

    Make sure to download the associated .sig file and to verify the authenticity of the tarball against it, along these lines:

    $ wget https://ftp.gnu.org/gnu/guix/guix-binary-1.4.0.x86_64-linux.tar.xz.sig
    $ gpg --verify guix-binary-1.4.0.x86_64-linux.tar.xz.sig
    

    If that command fails because you do not have the required public key, then run this command to import it:

    $ wget 'https://sv.gnu.org/people/viewgpg.php?user_id=15145' \
          -qO - | gpg --import -
    

    and rerun the gpg --verify command.

    Take note that a warning like “This key is not certified with a trusted signature!” is normal.

  2. Now, you need to become the root user. Depending on your distribution, you may have to run su - or sudo -i. As root, run:
    # cd /tmp
    # tar --warning=no-timestamp -xf \
         /path/to/guix-binary-1.4.0.x86_64-linux.tar.xz
    # mv var/guix /var/ && mv gnu /
    

    This creates /gnu/store (see The Store) and /var/guix. The latter contains a ready-to-use profile for root (see next step).

    Do not unpack the tarball on a working Guix system since that would overwrite its own essential files.

    The --warning=no-timestamp option makes sure GNU tar does not emit warnings about “implausibly old time stamps” (such warnings were triggered by GNU tar 1.26 and older; recent versions are fine). They stem from the fact that all the files in the archive have their modification time set to 1 (which means January 1st, 1970). This is done on purpose to make sure the archive content is independent of its creation time, thus making it reproducible.

  3. Make the profile available under ~root/.config/guix/current, which is where guix pull will install updates (see Invoking guix pull):
    # mkdir -p ~root/.config/guix
    # ln -sf /var/guix/profiles/per-user/root/current-guix \
             ~root/.config/guix/current
    

    Source etc/profile to augment PATH and other relevant environment variables:

    # GUIX_PROFILE="`echo ~root`/.config/guix/current" ; \
      source $GUIX_PROFILE/etc/profile
    
  4. Create the group and user accounts for build users as explained below (see Build Environment Setup).
  5. Run the daemon, and set it to automatically start on boot.

    If your host distro uses the systemd init system, this can be achieved with these commands:

    # cp ~root/.config/guix/current/lib/systemd/system/gnu-store.mount \
         ~root/.config/guix/current/lib/systemd/system/guix-daemon.service \
         /etc/systemd/system/
    # systemctl enable --now gnu-store.mount guix-daemon
    

    You may also want to arrange for guix gc to run periodically:

    # cp ~root/.config/guix/current/lib/systemd/system/guix-gc.service \
         ~root/.config/guix/current/lib/systemd/system/guix-gc.timer \
         /etc/systemd/system/
    # systemctl enable --now guix-gc.timer
    

    You may want to edit guix-gc.service to adjust the command line options to fit your needs (see Invoking guix gc).

    If your host distro uses the Upstart init system:

    # initctl reload-configuration
    # cp ~root/.config/guix/current/lib/upstart/system/guix-daemon.conf \
         /etc/init/
    # start guix-daemon
    

    Otherwise, you can still start the daemon manually with:

    # ~root/.config/guix/current/bin/guix-daemon \
           --build-users-group=guixbuild
    
  6. Make the guix command available to other users on the machine, for instance with:
    # mkdir -p /usr/local/bin
    # cd /usr/local/bin
    # ln -s /var/guix/profiles/per-user/root/current-guix/bin/guix
    

    It is also a good idea to make the Info version of this manual available there:

    # mkdir -p /usr/local/share/info
    # cd /usr/local/share/info
    # for i in /var/guix/profiles/per-user/root/current-guix/share/info/* ;
      do ln -s $i ; done
    

    That way, assuming /usr/local/share/info is in the search path, running info guix will open this manual (see Other Info Directories in GNU Texinfo, for more details on changing the Info search path).

  7. To use substitutes from ci.guix.gnu.org, bordeaux.guix.gnu.org or a mirror (see Substitutes), authorize them:
    # guix archive --authorize < \
         ~root/.config/guix/current/share/guix/ci.guix.gnu.org.pub
    # guix archive --authorize < \
         ~root/.config/guix/current/share/guix/bordeaux.guix.gnu.org.pub
    

    Note: If you do not enable substitutes, Guix will end up building everything from source on your machine, making each installation and upgrade very expensive. See On Trusting Binaries, for a discussion of reasons why one might want do disable substitutes.

  8. Each user may need to perform a few additional steps to make their Guix environment ready for use, see Application Setup.

Voilà, the installation is complete!

You can confirm that Guix is working by installing a sample package into the root profile:

# guix install hello

The binary installation tarball can be (re)produced and verified simply by running the following command in the Guix source tree:

make guix-binary.system.tar.xz

... which, in turn, runs:

guix pack -s system --localstatedir \
  --profile-name=current-guix guix

See Invoking guix pack, for more info on this handy tool.


Next: Requirements, Up: Installation   [Contents][Index]