I was trying to install the latest version of cabal-install on Ubuntu 14.04 with ghc 7.8.2. Here are the error messages and versions of things:
~/D/ghc-7.8.2> cabal install cabal-install
...
Linking dist/build/cabal/cabal ...
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
cabal: Error: some packages failed to install:
cabal-install-1.20.0.3 failed during the building phase. The exception was:
ExitFailure 1
~/D/ghc-7.8.2> which ld
/usr/bin/ld
~/D/ghc-7.8.2> ld -v
GNU ld (GNU Binutils for Ubuntu) 2.24
~/D/ghc-7.8.2> ld -lz
ld: cannot find -lz
~/D/ghc-7.8.2> cabal -V
cabal-install version 1.20.0.3
It's not a huge deal since my cabal version is pretty new... but I'd like to know how to fix this. I did not have this problem in Ubuntu 13.10.
Perhaps Ubuntu 14.04 has a new version of ld that does not support the -lz
flag?