source:https://mirror.tuna.tsinghua.edu.cn/help/hackage/
hackage 镜像使用帮助
初次使用
先执行
cabal update
待生成~/.cabal/config
之后Ctrl+C
, 然后进行下一步。
已经存在config
修改~/.cabal/config
, 将此行
remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive
注释掉,改为
remote-repo: mirrors.tuna.tsinghua.edu.cn:http://mirrors.tuna.tsinghua.edu.cn/hackage
-- remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive
注意,此处的注释是两条短线--
.
再执行cabal update
, 即可使用cabal
安装包了。
在 stack
中使用
修改~/.stack/config.yaml
, 加上:
package-indices:
- name: Tsinghua
download-prefix: http://mirrors.tuna.tsinghua.edu.cn/hackage/package/
http: http://mirrors.tuna.tsinghua.edu.cn/hackage/00-index.tar.gz