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. jquery checkbox选中

    楼主写的在1.6之前是没有问题的,jquery 1.6后就要这样写了,<input type='checkbox' id='cb'/> <script> //获取是否选中 va ...

  2. Keil的使用方法(汇总)

    推荐 分享一个大神的人工智能教程.零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到人工智能的队伍中来! http://www.captainbed.net/strongerhuang 软件的开发 ...

  3. Jquery右下角消息提示框

    找了好久,终于找到一个不错的提示框jquery,免费给大家一起用下吧(可是花了我很多积分哦),顺便重写了一下样式,原来的样式真的不敢恭维啊... 下载地址:http://files.cnblogs.c ...

  4. ansible IP

    问题解决了,用IP: "{{ ansible_eth0'ipv4' }}" 而不是{{ansible_all_ipv4_addresses}} 修改了之后的playbook 如下: ...

  5. C#调用Oracle存储过程

    C#调用Oracle存储过程的代码如下所示: using System; using System.Collections.Generic; using System.Collections.Obje ...

  6. PHP多进程编程(一)

    虽然PHP 中,多进程用的比较的少.但是毕竟可能是会用到了.我最近就遇到这样一个问题,用户提交几百个url以后,要读出这个url 中的标题. 当然,你不希望用户等待的太久,10s 钟应该给出个答案.但 ...

  7. EasyUI Tree checkbox node

    tree插件允许你创建checkbox tree,如果你点击节点的checkbox,被点击的节点信息得到下和上的继承.例如,点击tomato节点的checkbox,你可以看到vegetables节点现 ...

  8. Web设计的速查卡(转)

    一.排版 1.VisiBone Font Card Download: GIF 2.常用字体表 (HTML) 3.混合字体 (PDF) 二.单元/尺寸 1.Points 和Pixels近似转换表 (H ...

  9. php -- 魔术方法 之 设置属性:__set()

    属性重载:当访问一个不存在或者权限不够的属性的时候,能够触发一系列的魔术方法,就叫做属性重载 __set():当用户在设置不存在或者权限不够的属性的时候会自动触发 没有设置__set($name,$v ...

  10. 【BZOJ】1650: [Usaco2006 Dec]River Hopscotch 跳石子(二分+贪心)

    http://www.lydsy.com/JudgeOnline/problem.php?id=1650 看到数据和最小最大时一眼就是二分... 但是仔细想想好像判断时不能贪心? 然后看题解还真是贪心 ...