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. shell自动交互之expect脚本_转

    转自:linux expect详解(ssh自动登录) shell脚本实现ssh自动登录远程服务器示例: #!/usr/bin/expect spawn ssh root@192.168.22.194 ...

  2. exif_imagetype() 函数在linux下的php中不存在

    1.问题,项目中上传文件使用插件时,windows上支持函数exif_imagetype(),而在linux上不支持. 2.PHP exif_imagetype的本质 PHP exif_imagety ...

  3. bootstrap基础学习七篇

    bootstrap图片 Bootstrap 提供了三个可对图片应用简单样式的 class: .img-rounded:添加 border-radius:6px 来获得图片圆角. .img-circle ...

  4. eclipse中打开含有汉字的properties文件显示乱码

    http://blog.csdn.net/wangjun5159/article/details/46965831

  5. php求数学对数

    php的对数函数并不是很强大 有自然对数 有10的对数的函数,不过没有自定义底的对数函数,所以自己写了一个 <?php function xsqrt($x, $value) { $count = ...

  6. Android "Please ensure that adb is correctly located at" 错误

    转自:http://blog.csdn.net/hyx1990/article/details/12681207 遇到问题描述: 运行Android程序控制台输出 [2013-10-13 16:45: ...

  7. 自记(项目npm)

    cnpm install pug pug-cli vuex node-sass sass-loader vue-beauty axios 在main.js里面使用vue-beauty: import ...

  8. js(jQuery)相关随笔

    //获取所有name='id'.被选择的的多选框var idArr = $("input[type='checkbox'][name='id']:checked");//将这些多选 ...

  9. WCF:并发处理

    当多个线程同时访问相同的资源的时候就会产生并发,WCF缺省情况下会保护并发访问.对并发访问需要恰当处理,控制不好不仅会大大降低WCF服务的吞吐量和性能,而且还有可能会导致WCF服务的死锁.一.WCF并 ...

  10. java中计算时间差

    Calendar cale = null; SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss" ...