Skip to content

Latest commit

 

History

History
186 lines (100 loc) · 8.59 KB

install_and_upgrade.md

File metadata and controls

186 lines (100 loc) · 8.59 KB

Distribution packages are available for Ubuntu, Debian, CentOS / Red Hat, Fedora and Arch Linux. Binaries for other operating systems are available on the releases page. For the future, we have plans to support more OSes.

Binary packages are signed with this signing key.

Windows

Note: Due to specific Windows limitations, some temporary workarounds may be required. It is strongly advised to set your STACK_ROOT environment variable similarly to your root (e.g., set STACK_ROOT=c:\stack_root) before running stack.

  • Download the latest release. Note: while generally i386/32-bit GHC is better tested on Windows, there are reports that recent versions of Windows only work with the 64-bit version of stack (see issue #393).
  • Unpack the archive and place stack.exe somewhere on your %PATH% (see Path section below) and you can then run stack on the command line.
  • Now you can run stack from the terminal.

NOTE: These executables have been built and tested on a Windows 7, 8.1, and 10 64-bit machines. They should run on older Windows installs as well, but have not been tested. If you do test, please edit and update this page to indicate as such.

OS X

We generally test on the current version of OS X, but stack is known to work on Mavericks as well, and may also work on older versions (YMMV).

Ubuntu

note: for 32-bit, use the generic Linux option

  1. Get the FP Complete key:

     wget -q -O- https://s3.amazonaws.com/download.fpcomplete.com/ubuntu/fpco.key | sudo apt-key add -
    
  2. Add the appropriate source repository:

    • Ubuntu 15.10 (amd64):

      echo 'deb http://download.fpcomplete.com/ubuntu/wily stable main'|sudo tee /etc/apt/sources.list.d/fpco.list

    • Ubuntu 15.04 (amd64):

        echo 'deb http://download.fpcomplete.com/ubuntu/vivid stable main'|sudo tee /etc/apt/sources.list.d/fpco.list
      
    • Ubuntu 14.10 (amd64)

        echo 'deb http://download.fpcomplete.com/ubuntu/utopic stable main'|sudo tee /etc/apt/sources.list.d/fpco.list
      
    • Ubuntu 14.04 (amd64)

        echo 'deb http://download.fpcomplete.com/ubuntu/trusty stable main'|sudo tee /etc/apt/sources.list.d/fpco.list
      
    • Ubuntu 12.04 (amd64)

        echo 'deb http://download.fpcomplete.com/ubuntu/precise stable main'|sudo tee /etc/apt/sources.list.d/fpco.list
      
  3. Update apt and install

     sudo apt-get update && sudo apt-get install stack -y
    

Debian

note: for 32-bit, use the generic Linux option

  1. Get the FP Complete key:

     wget -q -O- https://s3.amazonaws.com/download.fpcomplete.com/debian/fpco.key | sudo apt-key add -
    
  2. Add the appropriate source repository:

    • Debian 8 (amd64):

        echo 'deb http://download.fpcomplete.com/debian/jessie stable main'|sudo tee /etc/apt/sources.list.d/fpco.list
      
    • Debian 7 (amd64)

        echo 'deb http://download.fpcomplete.com/debian/wheezy stable main'|sudo tee /etc/apt/sources.list.d/fpco.list
      
  3. Update apt and install

     sudo apt-get update && sudo apt-get install stack -y
    

CentOS / Red Hat / Amazon Linux

note: for 32-bit, use the generic Linux option

  1. Add the appropriate source repository:

    • CentOS 7 / RHEL 7 (x86_64)

        curl -sSL https://s3.amazonaws.com/download.fpcomplete.com/centos/7/fpco.repo | sudo tee /etc/yum.repos.d/fpco.repo
      
    • CentOS 6 / RHEL 6 (x86_64)

        curl -sSL https://s3.amazonaws.com/download.fpcomplete.com/centos/6/fpco.repo | sudo tee /etc/yum.repos.d/fpco.repo
      
  2. Install:

     sudo yum -y install stack
    

Fedora

note: for 32-bit, you can use this Fedora Copr repo which can be enabled with:

    sudo dnf copr enable petersen/stack
  1. Add the appropriate source repository:

    • Fedora 22 (x86_64)

        curl -sSL https://s3.amazonaws.com/download.fpcomplete.com/fedora/22/fpco.repo | sudo tee /etc/yum.repos.d/fpco.repo
      
    • Fedora 21 (x86_64)

        curl -sSL https://s3.amazonaws.com/download.fpcomplete.com/fedora/21/fpco.repo | sudo tee /etc/yum.repos.d/fpco.repo
      
  2. Install:

    • Fedora 22+

        sudo dnf -y install stack
      
    • Fedora < 22

        sudo yum -y install stack
      

Arch Linux

note: for 32-bit, use the generic Linux option. (You will need to ensure libtinfo is installed, see below.)

stack can be found in the AUR:

In order to install stack from Hackage or from source, you will need the libtinfo Arch Linux package installed. If this package is not installed, stack will not be able to install GHC.

If you use the ArchHaskell repository, you can also get the haskell-stack package from there.

NixOS

Users who follow the nixos-unstable channel or the Nixpkgs master branch can install the latest stack release into their profile by running:

     nix-env -f "<nixpkgs>" -iA haskellPackages.stack

Alternatively, the package can be built from source as follows.

  1. Clone the git repo:

      git clone https://github.com/commercialhaskell/stack.git
    
  2. Create a shell.nix file:

      cabal2nix --shell ./. --no-check --no-haddock > shell.nix
    

    Note that the tests fail on NixOS, so disable them with --no-check. Also, haddock currently doesn't work for stack, so --no-haddock disables it.

  3. Install stack to your user profile:

      nix-env -i -f shell.nix
    

For more information on using Stack together with Nix, please see the NixOS manual section on Stack.

Linux

(64-bit and 32-bit options available)

  • Download the latest release. Note: the -gmp4 variants are for older distributions (such as CentOS 6.x) that only include libgmp4 (libgmp.so.3).
  • Extract the archive and place stack somewhere on your $PATH (see Path section below)
  • Now you can run stack from the terminal.

Tested on Fedora 20: make sure to install the following packages sudo yum install perl make automake gcc gmp-devel. For Gentoo users, make sure to have the ncurses package with USE=tinfo (without it, stack will not be able to install GHC).

Path

You can install stack by copying it anywhere on your PATH environment variable. We recommend installing in the same directory where stack itself will install executables (that way stack is able to upgrade itself!). On Windows, that directory is %APPDATA%\local\bin, e.g. "c:\Users\Michael\AppData\Roaming\local\bin". For other systems, use $HOME/.local/bin.

If you don't have that directory in your PATH, you may need to update your PATH (such as by editing .bashrc).

If you're curious about the choice of these paths, see issue #153

Upgrade

There are essentially three different approaches to upgrade:

  • If you're using a package manager (e.g., the Ubuntu debs listed above) and are happy with sticking with the officially released binaries, simply follow your normal package manager strategies for upgrading (e.g. apt-get update && apt-get upgrade).
  • If you're not using a package manager but want to stick with the official binaries (such as on Windows or Mac), you'll need to manually follow the steps above to download the newest binaries from the release page and replace the old binary.
  • The stack tool itself ships with an upgrade command, which will build stack from source and install it to the default install path (see the previous section). You can use stack upgrade to get the latest official release, and stack upgrade --git to install from Git and live on the bleeding edge. If you follow this, make sure that this directory is on your PATH and takes precedence over the system installed stack. For more information, see this discussion.