I decided to try my file manager on Ubuntu, to see how it functioned on a Debian OS. In theory it should have worked the same, and I haven’t had a chance to try it out fully yet, so I can’t comment on that just yet, but installing GHC and Gtk2HS on Ubuntu is slightly more complex than on Fedora, where there was a package that took care of everything.
GHC
Firstly install GHC:
$ sudo apt-get install ghc
Note: This package doesn’t install all the GHC libraries, just core functionality, stuff like Text.Regex.Posix has to be installed using Cabal, detailed later.
GTK2HS
Next, get the source for Gtk2HS, I’m installing Gtk2HS 0.9.13. Download that to your home directory and unpack it.
Open a terminal and change to the where you unpacked it, for me that was:
Now install some dependencies for the Gtk2HS package:
$ sudo apt-get install build-essential libghc6-mtl-dev libglib2.0-dev build-dep libghc6-gtk-dev
Now run the configuration script ( with hcflags set to O2 for optimized code in the library – slower build )
$ ./configure --with-hcflags=O2
Next, the package needs to be built and installed:
$ sudo make
$ sudo make install
Thats it! Gtk2HS is installed.
To be sure that it is installed properly, navigate to the demo folder inside the Gtk2HS source folder, for me it was:
$ cd ~/gtk2hs-0.9.13/demo/hello/
Now compile the file that’s in there, and run it:
If you get any errors, you haven’t installed it properly. If not, and all is well, you should see something like this:

Cabal
My file manager uses the Text.Regex.Posix library, which is included in the Fedora GHC package, but not in the Ubuntu one. So I needed to install it using Cabal install.
Firstly get the tar.gz file from this directory: cabal install package, and like the Gtk2HS package unpack it and navigate in a terminal to the folder, for me it was:
$ cd ~/cabal-install-x
where x is the version number
Next, install some dependencies:
$ sudo apt-get install libghc6-network-dev libghc6-parsec-dev
Now run the bootstrap.sh script as this installs the neccessary packages:
Note: You may need to make it executable:
$ sudo chmod +x bootstrap.sh
$ ./bootstrap.sh
That should install everything, and you will need to add the path that appears to your $PATH variable.
Now, the Text.Regex.Posix package is “regex-posix” for cabal install, so to install it type:
$ cabal install regex-posix
And that will do the business for you!
M