As a part of installing Ubuntu on my computer, i apt-get installed cabal. After running cabal update, i ran cabal install darcs, discovered that i needed curses, installed libncurses5-dev, discovered that i needed curl, installed that, and when it still didn’t work, ran cabal install darcs -f-curl.
This worked, but darcs doesn’t run from the shell when just running darcs. It was installed in ~/.cabal/bin/darcs, so i made a link from there to /bin. Darcs now works from the shell, but i am left wondering if there is a better way to do it, perhaps running cabal install under sudo?
Firstly, do not use
sudo. Even when run under root,cabalbuilds stuff in your home directory, so usingsudoindiscriminately can lead to root-owned files in your~/.cabal. Instead, setroot-cmd: sudoin your/.cabal/config, thencabalwith the--globaloption will invoke that command as appropriate.Secondly, using local installs is generally more convenient and safer than using global ones, because you keep your package manager and
cabalseparate. So you could just as well add this to your~/.bashrc:and then continue to install stuff without using
sudoat all.See also: a slightly over-pessimistic, but nevertheless informative article on cabal package management.