Haskell environment hosed post reinstall

∥☆過路亽.° 提交于 2019-12-02 03:07:33

One approach is to remove your local ghc package cache:

$ cd  ~/.ghc/  &&  rm -rf  */package.conf.d
$ ghc-pkg --user recache

After you do this, try the cabal command again.

$ cabal install package-name

That should work. If it doesn't, try removing your cabal packages, then repeating the above steps:

$ rm -rf  ~/.cabal

If you're still having trouble, the missing package may be referred to by the system ghc package cache. Run this command:

$ ghc-pkg --user recache
$ sudo ghc-pkg recache
$ ghc-pkg -v check

The last command should print the system cache. On my GNU/Linux sytem, it prints this:

using cache: /home/sudoman/.ghc/x86_64-linux-7.6.3/package.conf.d/package.cache
using cache: /var/lib/ghc/package.conf.d/package.cache

At that point, I don't have a solution for you based on experience, but you may want to consider removing the ghc system package cache like above, then doing a recache; or re-installing ghc/haskell-platform.

the problem stems from the fact that cabal can track multiple versions of the same package.

Running:

cabal install --reinstall Cabal-1.18.1.3

fixes the problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!