download all of Hackage?

Herbert Valerio Riedel hvriedel at
Mon Sep 14 15:17:14 UTC 2015

On 2015-09-14 at 16:43:44 +0200, Richard Eisenberg wrote:
> Is there an easy way to download (but not compile) all of Hackage? I
> know of the hackager package, but that's about compiling. I just want
> a whole big load of Haskell code to play with. I thought I could find
> a link on Hackage to do this, but failed.

It's quite easy, you can iterate through the list of package names and
call 'cabal get' like e.g. (untested, but I've done this already -- you
may need to protect against execution errors)

  for PKG in $(cabal list --simple | awk '{ print $1 }' | uniq); do cabal get $PKG;done

another variant is to construct the URLs based on the output;

you can also get a list of packages in JSON format via

there's many ways to accomplish what you want...

More information about the ghc-devs mailing list