Install Haskell packages using cabal without internet connection

孤街浪徒 提交于 2019-12-04 08:32:18

From a machine you can access the internet you can either:

  • Run cabal get pkg-name where pkg-name is the package you want.
  • Go to the package's page on Hackage and on the Downloads section there's a .tar.gz file you can download.

After you get it, transfer it to your other machine, extract it anywhere you'd like (a sandbox if you want it just in a sandbox). Then from that directory (where there's a .cabal file) run cabal install.

Package managers, such as cabal, work internally to get a package from a remote repository. I doubt there exist an easy workaround to make cabal install a package in offline mode.

Probably the easiest way is to find a compressed version of package, find a way to get them on the offline computer (local sharing, thumb drive, etc.) and install a package manually.

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