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. 示例 - 向百度说 Hello world! 并获得回应.

    1. 让浏览器打开www.baidu.com, 并等待页面加载完毕: Default.Navigate("http://www.baidu.com"); Default.Ready ...

  2. codeforces 429 On the Bench dp+排列组合 限制相邻元素,求合法序列数。

    限制相邻元素,求合法序列数. /** 题目:On the Bench 链接:http://codeforces.com/problemset/problem/840/C 题意:求相邻的元素相乘不为平方 ...

  3. C++ c++与C语言的区别(空结构体)

    //区别⑨:空结构体声明(C++版本) #include<iostream> using namespace std; struct A{}; class B{}; void main() ...

  4. SSH三大框架的知识题

    Struts 谈谈你对Struts的理解. 答: 1.struts是一个按MVC模式设计的Web层框架,其实它就是一个大大的servlet,这个Servlet名为ActionServlet,或是Act ...

  5. 【BZOJ】1029: [JSOI2007]建筑抢修(贪心)

    http://www.lydsy.com/JudgeOnline/problem.php?id=1029 按右端点排序后依次加入,并且每一次看是否能被修筑,如果能就修:否则查找原来修过的,如果原来修过 ...

  6. xsocket:空闲超时问题。

    XSocket是什么? java的nio的封装. 详情: 1. http://xsocket.sourceforge.net/core/apidocs/2_1/index.html 2. http:/ ...

  7. js后台常用树形菜单

    来源:http://www.sucaihuo.com/js/1093.html demo: http://www.sucaihuo.com/jquery/10/1093/demo/

  8. Python3创建RIDE桌面快捷方式的另一种方法

    今天尝试了一下Python3下安装Robot Framework,但是原来的Python2下创建ride快捷方式的方法都不奏效,启动不了ride.于是,转为VBS脚本的方式来间接创建快捷方式.毕竟,每 ...

  9. VC++ 窗口拆分CSplitterWnd

    前言         当前许多优秀的软件都采用“多视”技术. 所谓“多视”,是指在同一个框架窗口里同时显示多个视图. 通过运用这种技术,可以在框架的有限控件内同时提供用户更大的信息量,并且使得用户界面 ...

  10. C# 直接调用非托管代码的方法

    C# 代码有以下两种可以直接调用非托管代码的方法: 直接调用从 DLL 导出的函数. 调用 COM 对象上的接口方法. 对于这两种技术,都必须向 C# 编译器提供非托管函数的声明,并且还可能需要向 C ...