How to install ghc on Ubuntu 20.04 (Focal Fossa)?

In this article we are going to learn the commands and steps to install ghc package on Ubuntu 20.04 (Focal Fossa).


 

Ads

Quick installation of ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3:

Step 1: Update system:

	sudo apt-get update

Step 2: Install: ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3

Ater updaing the OS run following command to install the packae:

	sudo apt-get install ghc
Architecture: amd64
Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3

Package Details

Package:ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3
Version:8.8.1+dfsg1+is+8.6.5+dfsg1-3
Maintainer:Ubuntu Developers
Home page:https://haskell.org/ghc/
Description:The Glasgow Haskell Compilation system The Glorious Glasgow Haskell Compilation system (GHC) is a compiler for Haskell. . Haskell is "the" standard lazy functional programming language. The language definition and additional documentation can be found in the `haskell-doc' package. Alternatively, there is an online version at http://haskell.org/onlinereport/.
Distro:Ubuntu 20.04 LTS
Release:
Repo/Section:universe/haskell

How to install ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3 on Ubuntu 20.04 LTS?

First of all update your system with the command:

sudo apt-get update

Ads

Above command will download the package lists for Ubuntu 20.04 LTS on your system. This will update the list of newest versions of packages and its dependencies on your system.

After downloading the latest package list with the help of above you can run the installation process.

If ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3 is not installed on your compter then the command 'dpkg -L ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3' will give followin error.

deepak@deepak-VirtualBox:~$ dpkg -L ghc
dpkg-query: package 'ghc' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
deepak@deepak-VirtualBox:~$ 

Installing ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3:

After system update use the following command to install ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3:

sudo apt-get install ghc
Architecture: amd64
Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3

Above command will confirm before installing the package on your Ubuntu 20.04 LTS Operating System. If you are not already logged in as su, installer will ask you the root password. After completion of the installation you can use the package on your system.

How to uninstall/remove ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3 from Ubuntu 20.04 LTS?

Now we will see the commands for uninstalling the ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3 from Ubuntu 20.04 LTS. For uninstalling this package you can easily use the apt command and remove the package from Linux Operating System.

To remove the ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3 following command is used:

sudo apt-get remove  ghc
Architecture: amd64
Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3

Following command is used to remove the ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3 package along with its dependencies:

sudo apt-get remove --auto-remove ghc
Architecture: amd64
Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3

This will remove ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3 and all its dependent packages which is no longer needed in the system.

Completely removing ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3 with all configuration files:

Following command should be used with care as it deletes all the configuration files and data:

sudo apt-get purge ghc
Architecture: amd64
Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3

or you can use following command also:

sudo apt-get purge --auto-remove ghc
Architecture: amd64
Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3

Above command will remove all the configuration files and data associated with ghc Architecture: amd64 Version: 8.8.1+dfsg1+is+8.6.5+dfsg1-3 package. You can can't recover the delete data, so, use this command with care.