Introduction
This tutorial explains how to reset your GHC installation packages, assuming they are installed on the user-level. It is a good idea to keep essential ‘system’ ghc packages installed at the root level, while installing packages you use for applications in your user system directory. In linux, this directory is ~/.ghc/. This guide was written for GHC version 6.12.1, but it should work for newer versions as well.
First, you must locate your ghc package configuration directory. This could be something like ~/.ghc/i386-linux-6.12.1. Create a backup of this directory in ~/.ghc/i386-linux-6.12.1.bak for example; Finally, run:
ghc-pkg init ~/.ghc/i386-linux-6.12.1
This will create a new empty directory for user-world packages. And you are done! You can proceed to install your new packages using cabal install <package_name>