cabal-install: The command-line interface for Cabal and Hackage.

[ bsd3, distribution, library, program ] [ Propose Tags ]

The 'cabal' command-line program simplifies the process of managing Haskell software by automating the fetching, configuration, compilation and installation of Haskell libraries and programs.

[Skip to Readme]


Manual Flags


Enable expensive assertions for testing or debugging


Add additional information to ConflictSets


Compile in support for tracetree (used to debug the solver)


Use parsec parser. This requires Cabal library built with its parsec flag enabled.


Build cabal-install also with all of its test and support code. Used by our continuous integration.

Automatic Flags

Use bytestring < 0.10.2 and bytestring-builder


Use directory < 1.2 and old-time


Get Network.URI from the network-uri package


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 0.4.0, 0.5.0, 0.5.1, 0.5.2, 0.6.0, 0.6.2, 0.6.4, 0.8.0, 0.8.2, 0.10.0, 0.10.2, 0.14.0, 0.14.1, 1.16.0,,,, 1.18.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Change log changelog
Dependencies array (>=0.4 && <0.6), async (>=2.0 && <2.2), base (>=4.5 && <4.11), base16-bytestring (>=0.1.1 && <0.2), binary (>=0.5 && <0.9), bytestring (>=0.9 && <0.11), bytestring-builder (>=0.10 && <1), Cabal (>= && <2.1), containers (>=0.4 && <0.6), cryptohash-sha256 (>=0.11 && <0.12), deepseq (>=1.3 && <1.5), directory (>=1.1 && <1.4), echo (>=0.1.3 && <0.2), edit-distance (>=0.2.2 && <0.3), filepath (>=1.3 && <1.5), ghc-prim (>=0.2 && <0.3), hackage-security (>= && <0.6), hashable (>=1.0 && <2), HTTP (>=4000.1.5 && <4000.4), mtl (>=2.0 && <2.3), network (>=2.4 && <2.7), network-uri (>=2.6 && <2.7), old-time (>=1 && <1.2), pretty (>=1.1 && <1.2), process (>= && <1.7), random (>=1 && <1.2), stm (>=2.0 && <2.5), tar (>= && <0.6), time (>=1.4 && <1.9), unix (>=2.5 && <2.8), Win32 (>=2 && <3), zlib (>=0.5.3 && <0.7) [details]
License BSD-3-Clause
Copyright 2003-2017, Cabal Development Team
Author Cabal Development Team (see AUTHORS file)
Maintainer Cabal Development Team <>
Revised Revision 3 made by HerbertValerioRiedel at 2018-09-17T09:59:00Z
Category Distribution
Home page
Bug tracker
Source repo head: git clone
Uploaded by MikhailGlushenkov at 2017-08-07T16:17:47Z
Distributions Arch:, Debian:, Fedora:, FreeBSD:, LTSHaskell:, NixOS:, openSUSE:
Reverse Dependencies 4 direct, 0 indirect [details]
Executables cabal
Downloads 258177 total (484 in the last 30 days)
Rating 2.5 (votes: 11) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2017-08-07 [all 2 reports]

Readme for cabal-install-

[back to package description]

The cabal-install package

See the Cabal web site for more information.

The cabal-install package provides a command line tool named cabal. It uses the Cabal library and provides a user interface to the Cabal/Hackage build automation and package management system. It can build and install both local and remote packages, including dependencies.

Installing the cabal command-line tool

The cabal-install package requires a number of other packages, most of which come with a standard GHC installation. It requires the network package, which is sometimes packaged separately by Linux distributions; for example, on Debian or Ubuntu, it is located in the "libghc6-network-dev" package.

cabal requires a few other Haskell packages that are not always installed. The exact list is specified in the .cabal file or in the file. All these packages are available from Hackage.

Note that on some Unix systems you may need to install an additional zlib development package using your system package manager; for example, on Debian or Ubuntu, it is located in the "zlib1g-dev" package; on Fedora, it is located in the "zlib-devel" package. It is required because the Haskell zlib package uses the system zlib C library and header files.

The cabal-install package is now part of the Haskell Platform, so you do not usually need to install it separately. However, if you are starting from a minimal GHC installation, you need to install cabal-install manually. Since it is an ordinary Cabal package, cabal-install can be built the standard way; to facilitate this, the process has been partially automated. It is described below.

Quick start on Unix-like systems

As a convenience for users on Unix-like systems, there is a script that will download and install each of cabal-install's dependencies in turn.

$ ./

It will download and install the dependencies. The script will install the library packages (vanilla, profiling and shared) into $HOME/.cabal/ and the cabal program into $HOME/.cabal/bin/. If you don't want to install profiling and shared versions of the libraries, use


You then have the choice either to place $HOME/.cabal/bin on your $PATH or move the cabal program to somewhere on your $PATH. Next, you can get the latest list of packages by running:

$ cabal update

This will also create a default configuration file, if it does not already exist, at $HOME/.cabal/config.

By default, cabal will install programs to $HOME/.cabal/bin. If you do not want to add this directory to your $PATH, you can change the setting in the config file; for example, you could use the following:

symlink-bindir: $HOME/bin

Quick start on Windows systems

For Windows users, a precompiled program (cabal.exe) is provided. Download and put it somewhere on your %PATH% (for example, C:\Program Files\Haskell\bin.)

Next, you can get the latest list of packages by running:

$ cabal update

This will also create a default configuration file (if it does not already exist) at C:\Documents and Settings\%USERNAME%\Application Data\cabal\config.

Using cabal

There are two sets of commands: commands for working with a local project build tree and those for working with packages distributed from Hackage.

For the list of the full set of commands and flags for each command, run:

$ cabal help

Commands for developers for local build trees

The commands for local project build trees are almost the same as the runghc Setup command-line interface you may already be familiar with. In particular, it has the following commands:

  • cabal configure
  • cabal build
  • cabal haddock
  • cabal clean
  • cabal sdist

The install command is somewhat different; it is an all-in-one operation. If you run cabal install in your build tree, it will configure, build, and install. It takes all the flags that configure takes such as --global and --prefix.

In addition, cabal will download and install any dependencies that are not already installed. It can also rebuild packages to ensure a consistent set of dependencies.

Commands for released Hackage packages

$ cabal update

This command gets the latest list of packages from the Hackage server. On occasion, this command must be run manually--for instance, if you want to install a newly released package.

$ cabal install xmonad

This command installs one or more named packages, and all their dependencies, from Hackage. By default, it installs the latest available version; however, you may specify exact versions or version ranges. For example, cabal install alex-2.2 or cabal install parsec < 3.

$ cabal list xml

This does a search of the installed and available packages. It does a case-insensitive substring match on the package name.