I have done the below steps to install cabal . I have already installed haskell platform using sudo apt-get install haskell-platform
http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html
Building Cabal from git
Assuming you already have a previous version of cabal installed:
$ git clone git://github.com/haskell/cabal.git /path/to/cabal
$ cd /path/to/cabal
$ cabal install Cabal/ cabal-install/
However when I try to initialize a sandbox, it throws error as below.
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ cabal sandbox --help
cabal: unrecognised command: sandbox (try --help)
Adding more details:
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ which cabal
/home/vagrant/.cabal/bin/cabal
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ cabal --help
This program is the command line interface to the Haskell Cabal infrastructure.
See http://www.haskell.org/cabal/ for more information.
Usage: cabal COMMAND [FLAGS]
or: cabal [GLOBAL FLAGS]
Global flags:
-h --help Show this help text
-V --version Print version information
--numeric-version Print just the version number
Commands:
install Installs a list of packages.
update Updates list of known packages
list List packages matching a search string.
info Display detailed information about a particular package.
fetch Downloads packages for later installation.
unpack Unpacks packages for user inspection.
check Check the package for common mistakes
sdist Generate a source distribution file (.tar.gz).
upload Uploads source packages to Hackage
report Upload build reports to a remote server.
init Interactively create a .cabal file.
configure Prepare to build the package.
build Make this package ready for installation.
copy Copy the files into the install locations.
haddock Generate Haddock HTML documentation.
clean Clean up after a build.
hscolour Generate HsColour colourised code, in HTML format.
register Register this package with the compiler.
test Run the test suite, if any (configure with UserHooks).
bench Run the benchmark, if any (configure with UserHooks).
upgrade (command disabled, use install instead)
help Help about commands
For more information about a command use:
cabal COMMAND --help
To install Cabal packages from hackage use:
cabal install foo [--dry-run]
Occasionally you need to update the list of available packages:
cabal update
You can edit the cabal configuration file to set defaults:
/home/vagrant/.cabal/config
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ cabal COMMAND --help
cabal: unrecognised command: COMMAND (try --help)
vagrant@vagrant-ubuntu-trusty-32:/usr/lib/haskell-packages$ cabal sandbox --help
cabal: unrecognised command: sandbox (try --help)