By default the cabal tool will install programs in <code>~/.cabal/bin</code>. If you decided not to put this directory on your <code>$PATH</code> then you can get cabal to symlink binaries into another directory, eg <code>~/bin</code>. To use this feature edit <code>~/.cabal/config</code> and see the <code>symlink-bindir field</code>. Note that the <code>~/.cabal/config</code> file is not created until you run a cabal command for the first time, eg <code>cabal update</code>.

By default the cabal tool will install programs in <code>~/.cabal/bin</code>. If you decided not to put this directory on your <code>$PATH</code> then you can get cabal to symlink binaries into another directory, eg <code>~/bin</code>. To use this feature edit <code>~/.cabal/config</code> and see the <code>symlink-bindir field</code>. Note that the <code>~/.cabal/config</code> file is not created until you run a cabal command for the first time, eg <code>cabal update</code>.

+

== Error reporting ==

== Error reporting ==

Line 109:

Line 110:

* The [https://github.com/haskell/cabal Cabal] page on GitHub.

* The [https://github.com/haskell/cabal Cabal] page on GitHub.

* [http://www.vex.net/~trebla/haskell/cabal-cabal.xhtml The Cabal of Cabal], the undocumented or obscure artifices and intrigues of Cabal.

* [http://www.vex.net/~trebla/haskell/cabal-cabal.xhtml The Cabal of Cabal], the undocumented or obscure artifices and intrigues of Cabal.

* [[Hack-Nix]] alternative based on the [http://nixos.org Nix] package manager.

* [[Hack-Nix]] alternative based on the [http://nixos.org Nix] package manager.

* [[Capri]] a wrapper over cabal-install and [[ghc-pkg]] to operate in project-private mode; similar to [[Hack-Nix]] but does not involve any extra software..

* [[Capri]] a wrapper over cabal-install and [[ghc-pkg]] to operate in project-private mode; similar to [[Hack-Nix]] but does not involve any extra software..

Revision as of 15:59, 14 November 2013

The cabal-install package provides the cabal command-line tool which simplifies the process of managing Haskell software
by automating the fetching, configuration, compilation and installation of Haskell libraries and programs.
Those packages must be prepared using Cabal and should be present at Hackage.

cabal install Package in the current directory
cabal install foo Package from the hackage server
cabal install foo-1.0 Specific version of a package
cabal install 'foo < 2' Constrained package version
cabal install foo bar baz Several packages at once
cabal install foo --dry-run Show what would be installed
cabal install foo --constraint=bar==1.0 Use version 1.0 of package bar

One thing to be especially aware of, is that the packages are installed locally by default, whereas the commands

2.2 Unix

It includes a shell script bootstrap.sh that you can run to download and install the other dependencies.

Note this assumes you have the zlib C library and its header files installed. Those header files are usually in a native system package like zlib-devel (On debian-based systems it is zlib1g-dev). You should also have the Haskell packages parsec and network installed. If you installed GHC via your native system package manager then you may also need to use it to install these two packages. (On debian-based systems they are called libghc6-parsec-dev and libghc6-network-dev.)

If this completes successfully you will have the cabal binary in ~/.cabal/bin. You should either add this directory to your $PATH or copy the cabal program to some location that is on your $PATH, eg ~/bin.

to get the current list of package from hackage you should now run:

cabal update

By default the cabal tool will install programs in ~/.cabal/bin. If you decided not to put this directory on your $PATH then you can get cabal to symlink binaries into another directory, eg ~/bin. To use this feature edit ~/.cabal/config and see the symlink-bindir field. Note that the ~/.cabal/config file is not created until you run a cabal command for the first time, eg cabal update.

3 Error reporting

4 FAQ

4.1 I just installed packages, but now the packages are not found

This happens when you install a package globally, and the previous packages were installed locally. Note that cabal-install install locally by default and the "runhaskell Setup" commands install globally by default.

4.2 How can I uninstall packages?

There is no "cabal uninstall" command. You can only unregister packages with ghc-pkg: