I recently followed these steps to install Haskell on CentOS 6.4
Please notice i didn't introduce any fancy flags. And the result is the following packages are located at /usr/local/lib:
async-2.0.1.4
attoparsec-0.10.4.0
case-insensitive-1.0.0.1
cgi-3001.1.7.5
fgl-5.4.2.4
GLURaw-1.3.0.0
GLUT-2.4.0.0
hashable-1.1.2.5
haskell-src-1.0.1.5
html-1.0.1.2
HTTP-4000.2.8
HUnit-1.2.5.2
mtl-2.1.2
network-2.4.1.2
OpenGL-2.8.0.0
OpenGLRaw-1.3.0.0
parallel-3.2.0.3
parsec-3.1.3
primitive-0.5.0.1
QuickCheck-2.6
random-1.0.1.1
regex-base-0.93.2
regex-compat-0.95.1
regex-posix-0.95.2
split-0.2.2
stm-2.4.2
syb-0.4.0
text-0.11.3.1
transformers-0.3.0.0
unordered-containers-0.2.3.0
vector-0.10.0.1
xhtml-3000.2.1
zlib-0.5.4.1
And the following are located under /usr/local/lib/ghc-7.6.3:
array-0.4.0.1
base-4.6.0.1
bin-package-db-0.0.0.0
binary-0.5.1.1
bytestring-0.10.0.2
Cabal-1.16.0
containers-0.5.0.0
deepseq-1.3.0.1
directory-1.2.0.1
filepath-1.3.0.1
ghc-7.6.3
ghc-prim-0.3.0.0
haskell2010-1.1.1.0
haskell98-2.0.0.2
hoopl-3.9.0.0
hpc-0.6.0.0
integer-gmp-0.5.0.0
old-locale-1.0.0.5
old-time-1.1.0.1
pretty-1.1.1.0
process-1.1.0.2
template-haskell-2.8.0.0
time-1.4.0.1
unix-2.6.0.1
I define myself as a cabal-noob and previously, as i installed haskell per user, i used to delete the whole .cabal folder when i got into the cabal hell. This sorcery package distribution freaks me out a bit, because i have the feeling i won't be able to fix a cabal hell as easy as before.
Why those packages installed in those locations?
/usr/local/lib/ghc-7.6.3 contains libraries that come with ghc. And /usr/local/lib contains libraries from "haskell platform"
How do i delete the whole cabal packages for reinstall?
Use ghc-pkg
to unregister libraries in /usr/local/lib. It is better not to do that with libraries /usr/local/lib/ghc-7.6.3
Which installation options allow me to put all cabal packages into a single folder?
AFAIK there are no such option
(not tutorial intended) Is it better to learn to solve the cabal hell? I've heard about ghc-pkg
After the new constrains solver was introduced in cabal, the cabal hell almost disappeared for me. The last cabal-install
release introduced sandboxes, and other improvements coming. I hope the cabal hell will disappear completely in near future.
Sometimes it is necessary to manually solve dependency conflicts by e.g. unregistering some packages using ghc-pkg
.
i used to delete the whole .cabal folder when i got into the cabal hell
You should delete ~/.ghc/
subfolder instead of ~/.cabal
. It is where ghc stores package db. With new cabal sandboxes you need to delete only the sandbox itself (cabal sandbox delete
)