For Ubuntu:

Step one: Install GHC

If you don't want to install curl you can skip step 1 and just directly download ghc package.

1. Install curl first.

sudo apt-get install gcc libgmp3-dev curl

2.Make a directory to get the ghc package.

For 64 bit machine, get the following package:

cabal update
curl -O http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-x86_64-unknown-linux.tar.bz2

For 32 bit machine, get the following package:

curl -O http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-i386-unknown-linux.tar.bz2

3. Decompress the tar package and install GHC, before doing that install some lib.

sudo apt-get install libgmp3-dev

sudo apt-get install libgmp3c2

tar -xjvf ghc-7.6.3-x86_64-unknown-linux.tar.bz2 or tar -xjvf ghc-7.6.3-i386-unknown-linux.tar.bz2

cd ghc-7.6.3
./configure
sudo make install

4. Check the version.

ghc --version

If it is ok, you will see:

The Glorious Glasgow Haskell Compilation System, version 7.6.3

Step two : Install Haskell Platform

1. Download the package first.

curl -O http://lambda.haskell.org/platform/download/2013.2.0.0/haskell-platform-2013.2.0.0.tar.gz
tar -xf haskell-platform-2013.2.0.0.tar.gz

2. Install the following package:

sudo apt-get install libglc-dev
sudo apt-get install freeglut3-dev

3. cd to haskell-platform-2013.2.0.0

./configure

sudo make

sudo make install

4. Last it will suggest you to Use "cabal install <foo>" to install additional packages, just update cabal

cabal update

That's done.

For CentOS:

It is almost the same as ubuntu except some places to notice.
Step one: Install GHC
1. Directly download the GHC tar and extract it to a folder.
cd ghc-7.6.3
./configure
sudo make install
</pre><pre code_snippet_id="370751" snippet_file_name="blog_20140530_14_1907562" name="code" class="plain">ghc --version

It is the same as before.

Step two : Install Haskell Platform
1. Directly downlaod haskell-platform-2013.2.0.0.tar.gz and extract it to a folder.
When run configure, it will get error that can't find some lib files like The zlib C library is required. 
I search a lot and even I download the zlib and installed manually can't resolve this problem.
Finally I find a solution, just install the following:
yum install gmp gmp-devel freeglut freeglut-devel libX11-devel mesa-libGLU-devel zlib-devel

It will resolve the issue. That's great.

Then run the following as before, it will install haskell platform successfully.
./configure

sudo make

sudo make install

cabal update

Reference:

http://powman.org/archives/haskell_env.html

http://tryhaskell.org/  

Install Haskell on Ubuntu and CentOS的更多相关文章

  1. 在Linux(Ubuntu/openSUSE/CentOS)下配置ASP.NET(Apache + Mono)

    [题外话] 闲的无聊竟然想尝试测试自己做的项目在不同操作系统上的性能表现,所以决定试试在Linux上部署Apache和Mono的环境.由于平时很少接触Linux,所以从网上找了几篇文章(附在相关链接中 ...

  2. 在Linux(Ubuntu/openSUSE/CentOS)下配置ASP.NET(Apache + Mono)转载+补充

    错误:Network error: Connection refused 解决办法: 执行 $sudo apt-get install openssh-server 安装ssh协议 执行ifconfi ...

  3. 【实战】Docker 入门实战一:ubuntu 和 centos 安装Docker

    Docker是什么 Docker 是一个开源的应用容器引擎,基于 Go 语言 并遵从Apache2.0协议开源.Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后发布 ...

  4. 硬盘安装Linux(ubuntu,centos)

    硬盘安装Linux 使用硬盘安装Linux最大的好处不只是方便,是快速.之前使用U盘安装,很慢,没有记录具体时间.Ubuntu区别不大,本身比较小,安装介质只有2G(ubuntu18.10):Cent ...

  5. Linux下安装python,ftp,Ubuntu和centos配置静态ip以及下载地址

    一个服务器最多创建65535个端口Ubuntu apt-get aliyun转换https://www.cnblogs.com/hcl1991/p/7894958.htmlOpenSSLhttps:/ ...

  6. ubuntu和centos安装docker

    一. UBUNTU系统上 1. 卸载旧版本(新系统不用执行) sudo apt-get remove docker docker-engine docker.io     2. 安装docker st ...

  7. ubuntu与centos系统对比

    CentOS与Ubuntu该如何选择,哪个更好用.笔者在自媒体平台收集了一些网友的观点,较为经典,分享给大家.至于应该选择哪个,希望看完本文章后,读者心中有数. 观点1:CentOS适用于服务器,Ub ...

  8. 对比ubuntu与centos系统 ​​​​

    CentOS与Ubuntu该如何选择,哪个更好用.笔者在自媒体平台收集了一些网友的观点,较为经典,分享给大家.至于应该选择哪个,希望看完本文章后,读者心中有数. 观点1:CentOS适用于服务器,Ub ...

  9. 一起玩"Docker"之1——Ubuntu配置安装Docker运行环境并安装(Ubuntu、Centos)镜像

    Docker 是一个开源的应用容器引擎,基于 Go 语言 并遵从Apache2.0协议开源. Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后发布到任何流行的 Li ...

随机推荐

  1. arm + fpga 核心板

  2. Android——初学

  3. resize2fs命令出现这个错误“resize2fs: Operation not permitted While trying to add group #6656” 有数据的会丢数据

    1. resize2fs命令出现这个错误“resize2fs: Operation not permitted While trying to add group #6656”,并且在/var/log ...

  4. mysql 分区 限制

    MySQL分区的限制 •   只能对数据表的整型列进行分区源码天空,或者数据列可以通过分区函数转化成整型列 •   最大分区数目不能超过1024 •   如果含有唯一索引或者主键,则分区列必须包含在所 ...

  5. Spring Boot 属性配置&自定义属性配置

    在使用spring boot过程中,可以发现项目中只需要极少的配置就能完成相应的功能,这归功于spring boot中的模块化配置,在pom.xml中依赖的每个Starter都有默认配置,而这些默认配 ...

  6. DTD与XML Schema都是XML文档。(选择1项)

    DTD与XML Schema都是XML文档.(选择1项) A.正确 B.不正确 解答:DTD不是XML文件, schema是XML文档

  7. ThinkPHP跳转与重定向的区别

    跳转: 浏览器认为: 当前URL请求成功, 重新请求新的URL. 浏览器会 记录当前的URL 和 新的URL 在请求历史记录中. 回退, 是可以回退到, 当前的URL上的. (无论 success, ...

  8. jquery用ajax方式从后台获取json数据后如何将内容填充到下拉列表

    对于问题从后台获取json数据,将内容填充到下拉列表,代码非常简单,具体过程请看下面代码. 需求:url:链接     par:ID       sel:下拉列表选择器 function BuildS ...

  9. windows下查看dns缓存和刷新缓存

    ipconfig /displaydns 显示已有缓存,可能比较大建议 ipconfig /displaydns > C:\Users\SDWQ\Desktop\1.txt 再查看. 强制更新缓 ...

  10. log4net写txt日志

    1.配置: <configSections>节点下添加: <section name="log4net" type="log4net.Config.Lo ...