
Good morning, Good people of the haskell community! I need to develop a web(site)/application. I want to try using Yesod. First thing i need to install it. (I already have the haskell-platform) So I run: cabal update It tells me that a new version of cabal-install is available; then I run: cabal install cabal-install After doing whatever it wants to do, successfully (at least that's what I think the logs say; I didn't notice any error) I update my path to: export PATH=/home/.../.cabal/bin:$PATH Everything is "OK" now! But I still don't have a cabal-install binary, and this update has been performed only for me (inside my user account)! Shouldn't I have a binary cabal-install to run? How can I update globally? (for all users of the system!) After this I'm going to try to install Yesod! And of course I would like to install for all users of the system (yes I'm the only one:-) but I'm just asking...) Can anyone help me out? Thank You very much! Gilberto

Hi.
After doing whatever it wants to do, successfully (at least that's what I think the logs say; I didn't notice any error) I update my path to: export PATH=/home/.../.cabal/bin:$PATH
Everything is "OK" now! But I still don't have a cabal-install binary, and this update has been performed only for me (inside my user account)!
Shouldn't I have a binary cabal-install to run?
The binary is called "cabal", not "cabal-install". You should be able to check whether the new version is being used by saying "cabal --version".
How can I update globally? (for all users of the system!)
By saying something like "sudo cabal install --global cabal-install". Cheers, Andres

On Tue, Mar 18, 2014 at 11:54:21AM +0100, Andres Löh wrote:
Hi.
After doing whatever it wants to do, successfully (at least that's what I think the logs say; I didn't notice any error) I update my path to: export PATH=/home/.../.cabal/bin:$PATH
Everything is "OK" now! But I still don't have a cabal-install binary, and this update has been performed only for me (inside my user account)!
Shouldn't I have a binary cabal-install to run?
The binary is called "cabal", not "cabal-install". You should be able to check whether the new version is being used by saying "cabal --version".
How can I update globally? (for all users of the system!)
By saying something like "sudo cabal install --global cabal-install".
Incidentally, it's better to say 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. -Brent

Hi Brent.
By saying something like "sudo cabal install --global cabal-install".
Incidentally, it's better to say
cabal install --root-cmd=sudo --global cabal-install
Ah yes, absolutely true. Thanks for pointing this out. I never actually run "cabal install --global" manually, so I forgot that this is possible. Cheers, Andres

On Wed, Mar 19, 2014 at 12:02 AM, Brent Yorgey
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? -- Kim-Ee

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

On Tue, Mar 18, 2014 at 4:04 PM, Kim-Ee Yeoh
On Wed, Mar 19, 2014 at 12:02 AM, Brent Yorgey
wrote: cabal install --root-cmd=sudo --global cabal-install
Oh my. This is some long magical incantation. Is this documented somewhere? At least in the cabal faq?
Probably not since it's strongly disrecommended to do global installs. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (5)
-
Andres Löh
-
Brandon Allbery
-
Brent Yorgey
-
Gilberto Melfe
-
Kim-Ee Yeoh