
On Wed, Mar 19, 2014 at 03:04:26AM +0700, Kim-Ee Yeoh wrote:
On Wed, Mar 19, 2014 at 12:02 AM, Brent Yorgey
wrote: cabal install --root-cmd=sudo --global cabal-install
That way, cabal will only acquire root privileges for the installation. It does not need to run as root for the entire downloading, building, etc. process, and in fact doing so can be bad, since it pollutes your package cache with files owned by root, leading to potential permissions problems in the future.
Oh my. This is some long magical incantation.
Is this documented somewhere? At least in the cabal faq?
I don't know, I learned it from Duncan Coutts. For the record, I don't actually recommend that people do this. I can only think of a few situations where this is really what you want to do (e.g. if you are setting up a multi-user system that students in a class are going to use). More typically, you should leave the Haskell Platform in your global package DB and then install everything else in your local user DB. That makes it much easier to start over if things get messed up, without having to reinstall the Haskell Platform. For something like cabal-install which is just an executable, if you want to make it available globally it is easy enough to build it locally and then copy it somewhere to make it available. -Brent