RSS Feed
2013-11-18 11:01:44 UTC
Ron

This afternoon I was trying to install Control.Lens on a new machine when my internet died before cabal was able to finish working. When the internet came back online, running "cabal install lens" gave me an error.

Meow:~ ron$ cabal install lens
Resolving dependencies...
Failed to install MonadCatchIO-transformers-0.3.0.0
Failed to install generic-deriving-1.6.2
Failed to install reflection-1.3.2
cabal: Error: some packages failed to install:
MonadCatchIO-transformers-0.3.0.0 failed while unpacking the package. The
exception was:
user error (data is not in tar format)
generic-deriving-1.6.2 failed while unpacking the package. The exception was:
user error (data is not in tar format)
lens-3.10 depends on reflection-1.3.2 which failed to install.
reflection-1.3.2 failed while unpacking the package. The exception was:
user error (data is not in tar format)

When I saw the "user error (data is not in tar format)" exception, I figured the downloads for those libraries were corrupted when the internet died during the install. I did a quick scan of my ~/.cabal/config file and found the location for the downloaded binary tar files.

Meow:~ ron$ cat ~/.cabal/config | grep "packages"
--   ~/Library/Haskell for packages installed --user (the default)

I headed over to the the ~/Library/Haskell folder and started poking around. I found the repo-cache folder and inside had all the tar.gz files for downloaded libraries. A quick clean up of the broken libraries, and I was able to install Control.Lens correctly.

Meow:~ ron$ cd ~/Library/Haskell/repo-cache/hackage.haskell.org/
Meow:hackage.haskell.org ron$ rm -rf generic-deriving/
Meow:hackage.haskell.org ron$ rm -rf reflection/
Meow:hackage.haskell.org ron$ rm -rf MonadCatchIO-transformers/
Meow:hackage.haskell.org ron$ cabal install lens
Resolving dependencies...
Downloading MonadCatchIO-transformers-0.3.0.0...
Archives