How To Install ghc-compiler on CentOS 8

ghc-compiler is GHC compiler and utilities

Introduction

In this tutorial we learn how to install ghc-compiler on CentOS 8.

What is ghc-compiler

The package contains the GHC compiler, tools and utilities. The ghc libraries are provided by ghc-libraries. To install all of ghc (including the ghc library), install the main ghc package.

We can use yum or dnf to install ghc-compiler on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install ghc-compiler.

Install ghc-compiler on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install ghc-compiler using dnf by running the following command:

sudo dnf -y install ghc-compiler

Install ghc-compiler on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install ghc-compiler using yum by running the following command:

sudo yum -y install ghc-compiler

How To Uninstall ghc-compiler on CentOS 8

To uninstall only the ghc-compiler package we can use the following command:

sudo dnf remove ghc-compiler

ghc-compiler Package Contents on CentOS 8

/usr/bin/ghc
/usr/bin/ghc-8.2.2
/usr/bin/ghc-doc-index
/usr/bin/ghc-pkg
/usr/bin/ghc-pkg-8.2.2
/usr/bin/ghci
/usr/bin/ghci-8.2.2
/usr/bin/haddock
/usr/bin/haddock-ghc-8.2.2
/usr/bin/hp2ps
/usr/bin/hpc
/usr/bin/hsc2hs
/usr/bin/hsc2hs-ghc
/usr/bin/runghc
/usr/bin/runghc-8.2.2
/usr/bin/runhaskell
/usr/bin/runhaskell-ghc
/usr/lib/.build-id
/usr/lib/.build-id/0a
/usr/lib/.build-id/0a/12d46718d3d8f2c5169347cea44f3bf326b67c
/usr/lib/.build-id/26
/usr/lib/.build-id/26/485feb8d322da617cf9bd7450f285434d5be29
/usr/lib/.build-id/52
/usr/lib/.build-id/52/d5145708c3897b0422b26d3987d75702629ca6
/usr/lib/.build-id/62
/usr/lib/.build-id/62/dde6b0a5bf412444aaa8b9511c97b2dd37d513
/usr/lib/.build-id/88
/usr/lib/.build-id/88/e49fe3244e8c70161b38d6009f3baa3df58c1b
/usr/lib/.build-id/8b
/usr/lib/.build-id/8b/e07c9581402bd2d9b4f42c7bd89874aedf0f21
/usr/lib/.build-id/99
/usr/lib/.build-id/99/aa464fe58369296e7846bfc7c863e11b6e905f
/usr/lib/.build-id/b8
/usr/lib/.build-id/b8/59c176946e78adf89211a2ae890dcaed8d7491
/usr/lib/.build-id/c8
/usr/lib/.build-id/c8/baeae3ea9ed6554c757f0fa57c98cd6df5271d
/usr/lib/.build-id/da
/usr/lib/.build-id/da/ef01497d0c416a60d8260d7adaef09346ad110
/usr/lib/.build-id/e2
/usr/lib/.build-id/e2/dce479eb40e606add998d37f65e3cb78b9b565
/usr/lib64/ghc-8.2.2/bin
/usr/lib64/ghc-8.2.2/bin/ghc
/usr/lib64/ghc-8.2.2/bin/ghc-iserv
/usr/lib64/ghc-8.2.2/bin/ghc-iserv-dyn
/usr/lib64/ghc-8.2.2/bin/ghc-iserv-prof
/usr/lib64/ghc-8.2.2/bin/ghc-pkg
/usr/lib64/ghc-8.2.2/bin/ghc-split
/usr/lib64/ghc-8.2.2/bin/haddock
/usr/lib64/ghc-8.2.2/bin/hp2ps
/usr/lib64/ghc-8.2.2/bin/hpc
/usr/lib64/ghc-8.2.2/bin/hsc2hs
/usr/lib64/ghc-8.2.2/bin/runghc
/usr/lib64/ghc-8.2.2/bin/unlit
/usr/lib64/ghc-8.2.2/ghc-usage.txt
/usr/lib64/ghc-8.2.2/ghci-usage.txt
/usr/lib64/ghc-8.2.2/html
/usr/lib64/ghc-8.2.2/html/Classic.theme
/usr/lib64/ghc-8.2.2/html/Classic.theme/haskell_icon.gif
/usr/lib64/ghc-8.2.2/html/Classic.theme/minus.gif
/usr/lib64/ghc-8.2.2/html/Classic.theme/plus.gif
/usr/lib64/ghc-8.2.2/html/Classic.theme/xhaddock.css
/usr/lib64/ghc-8.2.2/html/Ocean.std-theme
/usr/lib64/ghc-8.2.2/html/Ocean.std-theme/hslogo-16.png
/usr/lib64/ghc-8.2.2/html/Ocean.std-theme/minus.gif
/usr/lib64/ghc-8.2.2/html/Ocean.std-theme/ocean.css
/usr/lib64/ghc-8.2.2/html/Ocean.std-theme/plus.gif
/usr/lib64/ghc-8.2.2/html/Ocean.std-theme/synopsis.png
/usr/lib64/ghc-8.2.2/html/haddock-util.js
/usr/lib64/ghc-8.2.2/html/highlight.js
/usr/lib64/ghc-8.2.2/html/solarized.css
/usr/lib64/ghc-8.2.2/latex
/usr/lib64/ghc-8.2.2/latex/haddock.sty
/usr/lib64/ghc-8.2.2/package.conf.d
/usr/lib64/ghc-8.2.2/package.conf.d/package.cache
/usr/lib64/ghc-8.2.2/package.conf.d/package.cache.lock
/usr/lib64/ghc-8.2.2/platformConstants
/usr/lib64/ghc-8.2.2/settings
/usr/lib64/ghc-8.2.2/template-hsc.h
/usr/share/doc/ghc
/usr/share/doc/ghc-compiler
/usr/share/doc/ghc-compiler/ANNOUNCE
/usr/share/doc/ghc/html
/usr/share/doc/ghc/html/libraries
/usr/share/doc/ghc/html/libraries/doc-index-124.html
/usr/share/doc/ghc/html/libraries/doc-index-126.html
/usr/share/doc/ghc/html/libraries/doc-index-33.html
/usr/share/doc/ghc/html/libraries/doc-index-36.html
/usr/share/doc/ghc/html/libraries/doc-index-37.html
/usr/share/doc/ghc/html/libraries/doc-index-38.html
/usr/share/doc/ghc/html/libraries/doc-index-42.html
/usr/share/doc/ghc/html/libraries/doc-index-43.html
/usr/share/doc/ghc/html/libraries/doc-index-45.html
/usr/share/doc/ghc/html/libraries/doc-index-46.html
/usr/share/doc/ghc/html/libraries/doc-index-47.html
/usr/share/doc/ghc/html/libraries/doc-index-58.html
/usr/share/doc/ghc/html/libraries/doc-index-60.html
/usr/share/doc/ghc/html/libraries/doc-index-61.html
/usr/share/doc/ghc/html/libraries/doc-index-62.html
/usr/share/doc/ghc/html/libraries/doc-index-92.html
/usr/share/doc/ghc/html/libraries/doc-index-94.html
/usr/share/doc/ghc/html/libraries/doc-index-A.html
/usr/share/doc/ghc/html/libraries/doc-index-All.html
/usr/share/doc/ghc/html/libraries/doc-index-B.html
/usr/share/doc/ghc/html/libraries/doc-index-C.html
/usr/share/doc/ghc/html/libraries/doc-index-D.html
/usr/share/doc/ghc/html/libraries/doc-index-E.html
/usr/share/doc/ghc/html/libraries/doc-index-F.html
/usr/share/doc/ghc/html/libraries/doc-index-G.html
/usr/share/doc/ghc/html/libraries/doc-index-H.html
/usr/share/doc/ghc/html/libraries/doc-index-I.html
/usr/share/doc/ghc/html/libraries/doc-index-J.html
/usr/share/doc/ghc/html/libraries/doc-index-K.html
/usr/share/doc/ghc/html/libraries/doc-index-L.html
/usr/share/doc/ghc/html/libraries/doc-index-M.html
/usr/share/doc/ghc/html/libraries/doc-index-N.html
/usr/share/doc/ghc/html/libraries/doc-index-O.html
/usr/share/doc/ghc/html/libraries/doc-index-P.html
/usr/share/doc/ghc/html/libraries/doc-index-Q.html
/usr/share/doc/ghc/html/libraries/doc-index-R.html
/usr/share/doc/ghc/html/libraries/doc-index-S.html
/usr/share/doc/ghc/html/libraries/doc-index-T.html
/usr/share/doc/ghc/html/libraries/doc-index-U.html
/usr/share/doc/ghc/html/libraries/doc-index-V.html
/usr/share/doc/ghc/html/libraries/doc-index-W.html
/usr/share/doc/ghc/html/libraries/doc-index-X.html
/usr/share/doc/ghc/html/libraries/doc-index-Y.html
/usr/share/doc/ghc/html/libraries/doc-index-Z.html
/usr/share/doc/ghc/html/libraries/doc-index.html
/usr/share/doc/ghc/html/libraries/gen_contents_index
/usr/share/doc/ghc/html/libraries/haddock-util.js
/usr/share/doc/ghc/html/libraries/hslogo-16.png
/usr/share/doc/ghc/html/libraries/index.html
/usr/share/doc/ghc/html/libraries/minus.gif
/usr/share/doc/ghc/html/libraries/ocean.css
/usr/share/doc/ghc/html/libraries/plus.gif
/usr/share/doc/ghc/html/libraries/prologue.txt
/usr/share/doc/ghc/html/libraries/synopsis.png
/usr/share/licenses/ghc-compiler
/usr/share/licenses/ghc-compiler/LICENSE
/usr/share/man/man1/ghc.1.gz
/var/lib/ghc
/var/lib/ghc/pkg-dir.cache
/var/lib/ghc/pkg-dir.cache.new

References

Summary

In this tutorial we learn how to install ghc-compiler on CentOS 8 using yum and dnf.