Cabal never updates - cabal

I'm trying to update Cabal on OSX (with ghci 7.8.2 installed), so I run the following commands
cabal update
cabal install cabal-install
To get it up to date, and the installation seems to complete with no errors. However, when I run cabal update again, it still says that I'm not up to date and to run cabal install cabal-install again.
I've read that I might have to do something to make the new version of Cabal have precedence over the one installed with Haskell, but I have no idea how to do this.

Turns out I needed to add /Users/username/Library/Haskell/bin
to $PATH to get the latest version to be used.

Related

Can't get Cabal-install to work on my mac

So, I'm trying to get cabal installed so I can get quickcheck to work in haskell, but nothing seems to work. Whenever I try to run "cabal-install" in my terminal (on mac) I get the same message "command not found", I've looked at multiple different "solutions" and even "solutions" on the cabal website, but nothing seems to work. Any help at all would be much appreciated
cabal-install is a package. cabal is the executable/command installed by the cabal-install package. cabal install is a subcommand of the cabal command—it's the command cabal called with the argument install. Your full command "should" be cabal install QuickCheck, but there's no point in actually executing that command. If you have Cabal v1 or v2, cabal install refers to the version 1 install method, which is broken and dangerous. If you have Cabal v3, cabal install refers to the version 2 install method, where cabal install QuickCheck is pointless. It will install QuickCheck, but QuickCheck is just a library with no executables, so there's no point.
Assuming cabal-install is correctly installed (you should have access to the cabal command), you need to figure out what you're going to do with QuickCheck. If you just want to open a GHCi session, say cabal v2-repl -b QuickCheck. If you want to compile a bunch of files (i.e. you want something more "permanent"), you need to create a package, where the <pkgname>.cabal file contains something along the lines of
build-depends: base, QuickCheck, ..etc
When you build such a package with cabal v2-build, or you start GHCi with cabal v2-repl -b QuickCheck, cabal will go and install QuickCheck automatically if it needs to. This is why cabal v2-install QuickCheck is pointless.

remove downloads from cabal installation

I wanted to install Idris, so I first installed Haskell and then wrote cabal update and cabal install idris in the terminal. However, after downloading and installing lots of components, the installation finally failed on some packages. I then did the installation via the Windows-.exe from idris-lang.org and now it runs fine, but I want to remove what was downloaded and installed before with the cabal command. Any idea how to do that? Is there such a command like "cabal deinstall idris" or something? Or would it affect the other installation too?

Haskell platform on mac installs cabal in /usr/bin, but cabal install goes in ~/Library/Haskell

I’ve just installed the Haskell Platform on my Mac running Mavericks 10.9. The cabal version included (1.16) is out of date, and prompts me to run “cabal update” and then “cabal install cabal-install". Doing so installs cabal 1.20.0.3, but it installs in ~/Library/Haskell. This is not in my executable path, so further attempts to run cabal result in executing version 1.16 from /usr/bin, which was not updated.
I guess I could get around this by changing my executable path to include ~/Library/Haskell, with higher preference than /usr/bin. But I don’t really want to do this. And I don’t want to maintain multiple out of date versions of the software in hidden locations on my system. How do I get cabal to update the executable in the right place? Running with sudo did not help.
Edit: Updated my path, but somehow it still doesn’t work:
[76 of 76] Compiling Main ( Main.hs, dist/build/cabal/cabal-tmp/Main.o )
Linking dist/build/cabal/cabal ...
Warning: No documentation was generated as this package does not contain a library. Perhaps you want to use the --executables flag.
Installing executable(s) in
/Users/lethe/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.3/bin
Installed cabal-install-1.20.0.3
Updating documentation index /Users/lethe/Library/Haskell/doc/index.html
euclid:Public lethe$ which cabal
/Users/lethe/Library/Haskell/bin/cabal
euclid:Public lethe$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library
euclid:Public lethe$ echo $PATH
/Users/lethe/Library/Haskell/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/usr/texbin
It claims it installed cabal 1.20.0.3 to ~/Library/Haskell, and since the path is updated, it claims it’s going to execute the version in ~/Library/Haskell, but it also claims the executed version is 1.16.0.2. What’s going on here?
I also tried ghc-pkg recache and cabal install cabal-install-1.20.0.3 (with version number specified), but executed version is still 1.16.0.2
There are a couple of solutions:
1) Try updating the PATH variable such that it looks in your local path first.
(Add this to your .bash_profile: export PATH=$HOME/Library/Haskell/bin:$PATH. Source the profile and then retry the whereis command to identify which binary you are using, it should use your local one)
Though this didn't work for me. I had to resort to the next step to make it work:
2) Brute force fix: Delete /usr/bin/cabal.
Hope this helps.
According to 23skiddo at GitHub, the way to get cabal to install in the system-wide directory is cabal install --global. Also if your shell is executing the wrong path to an executable you probably need to clear the cache with hash -d cabal or hash -r.
I once had an alias to a command and forgot about it. That is not picked up by "which ".
Try $(which cabal) --version. If it shows 1.20 there may be some similar problem. Use compgen -a to list your aliases.
/Users/lethe/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.3/bin also is not /Users/lethe/Library/Haskell/bin.
Also:
There is a new Haskell-Plattform release 2014.2 now. This comes with Cabal 1.18 and GHC 7.8.3.
It updates easily to Cabal 1.20 (I don't know why it does not come with 1.20 in the first place).
I already tried many different setups between using Haskell-Plattform, Homebrew ghc + haskell-plattform and also http://ghcformacosx.github.io/
Last one makes most sense to me after trying all different ways to use Haskell on OSX.
If you switch between different "distributions" make sure you really get rid of "everything" that is installed from other versions of Haskell.
I think the most important thing is to recognize that all of those installations are more or less the same. It just moves paths and preferences around.

Error while installing CodeLite IDE in Ubuntu

While installing CodeLite IDE in Ubuntu following error occurs.
Any idea?
ERROR:
The following packages have unmet dependencies:
codelite : Depends: libjbig0 but it is not installable
Depends: liblzma5 (>= 5.1.1alpha+20120614) but 5.1.1alpha+20110809-3 is to be installed
Depends: libpango-1.0-0 (>= 1.18.0) but it is not installable
Depends: libpangocairo-1.0-0 (>= 1.14.0) but it is not installable
E: Unable to correct problems, you have held broken packages.
I had a similar problem. You may need to check your version of Ubuntu, and that you've added the correct repositories. If this is the problem, then the fix is very simple!
Firstly, check your version of Ubuntu. From terminal you can do this with the command lsb_release -a. The important part, for our purpose, is the codename. I'm using Ubuntu 13, aka "saucy".
Now let's look at the multiverse repository that you added. From the terminal you can do this with sudo gedit /etc/apt/sources.list. Go down to the end of the file, and you should see something like:
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://repos.codelite.org/ubuntu/ saucy universe
Make sure that your version has your ubuntu codename (in my case 'saucy'). The example code on the website is for Ubuntu 14, and so I wrongly had a 'trusty' source here. Edit the line so that it is correct for your version of Ubuntu, and then save and close the file.
Lastly, you'll need to update your repos so that the change goes through. From the terminal, run sudo apt-get update. All being well, you should now be able to sudo apt-get install codelite without the errors.
My problem was caused by too much cutting-and-pasting code from the codelite website. I followed exactly the same page as you did, and their example code is for people with Ubuntu trusy (14).
You will need to be more specific on how you tried to install codelite.
The official Debian repository manages an ancient version of codelite which we (the codelite team) do not support.
In order to get the most up-to-date version (that we support) please install it from codelite's official website (select the Download at menu at the top)
Before installing, make sure you delete the folder ~/.codelite (incase you are upgrading)
Also, the official Debian installer is split into 2 pakacges codelite and codelite-plugins make sure you purge them both before installing codelite from our repository
I'm the author of Howto install the latest codelite in Ubuntu - EuroBytes. I have tested the latest codelite on Trusty.
If you still have issues with codelite, remove like so: sudo apt-get purge codelite
Note that the dependencies links are dead. But, i managed to install it anyways:
codelite 6.1 on Ubuntu Trusty Thar 14.04.
Image from: Howto install the latest codelite in Ubuntu - EuroBytes
Install like so:
sudo apt-add-repository "deb http://repos.codelite.org/ubuntu/ $(lsb_release -sc) universe"
sudo apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc
sudo apt-get update
sudo apt-get install codelite wxcrafter
Feel free to contact me here or on my site, for any issues you may have.
Source:
Howto install the latest codelite in Ubuntu - EuroBytes

cabal-install "Couldn't read cabal file ..."

I just made a fresh haskell-platform install on a Linux Mint 12, via apt-get. Everytime I try to install some hackage package with cabal-install, I get a:
couldn't read caba file xxxx.cabal
where xxxx is a dependency of the package I'm installing or the package itself. Based on this thread on haskell cafe and other questions here in SO, I deleted the bytestring package from the index:
tar -f ~/.cabal/packages/hackage.haskell.org/00-index.tar --delete bytestring/0.9.2.0
tar -f ~/.cabal/packages/hackage.haskell.org/00-index.tar --delete bytestring/0.9.2.1
but the errors are still there.
My cabal-install version is:
$ cabal --version
cabal-install version 0.10.2
using version 1.10.1.0 of the Cabal library
The error is like this:
$ cabal install yesod
Resolving dependencies...
cabal: Couldn't read cabal file "fsnotify/0.0.5/fsnotify.cabal"
Does anyone knows what might be happening?
I'm having the same problem. There's a relevant mailing list thread about this problem at http://haskell.1045720.n5.nabble.com/Cabal-install-fails-due-to-recent-HUnit-td5715081i20.html
I believe the upshot is that the format of the packages files has changed, and the cabal version in use here (I have the same version, obtained from ubuntu oneiric) can't understand the files. You can't even do "cabal install cabal-install".
The mailing list thread just peters out in september 2012 without a clear decision being made, but I think they decided to just ignore the problem. There's not a clear statement of what to do for users like us; I think the only approach possible is to install haskell from scratch, but I don't yet know where to start with that.
EDIT: I fixed this by downloading the latest source package of cabal from http://hackage.haskell.org/packages/archive/cabal-install/1.16.0.2/cabal-install-1.16.0.2.tar.gz, unpacking it and following the instructions in its README to do a local install.
I was having the same problem and I wasn't able to follow Richard's instructions, so I realized I was running version 7.0.?, I uninstalled it using the command $ uninstall-hs, then installed the newest version (7.6.3). Problem solved here.

Resources