gtk2hsTypeGen command not found

In this troubleshooting guide we learn how to fix gtk2hsTypeGen command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

gtk2hsTypeGen: command not found

or when using sudo you get the following error message

sudo: gtk2hsTypeGen: command not found

Solutions to gtk2hsTypeGen: command not found

How To Fix gtk2hsTypeGen: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu gtk2hsTypeGen is provided by gtk2hs-buildtools package.

gtk2hs-buildtools is:

This package provides a set of helper programs necessary to build the Gtk2Hs suite of libraries. These tools include a modified c2hs binding tool that is used to generate FFI declarations, a tool to build a type hierarchy that mirrors the C type hierarchy of GObjects found in glib, and a generator for signal declarations that are used to call back from C to Haskell. These tools are not needed to actually run Gtk2Hs programs.

To fix this problem, we can install more using the command below.

sudo apt-get -y install gtk2hs-buildtools

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install gtk2hs-buildtools.

sudo apt -y install gtk2hs-buildtools

Or if you have aptitude installed you can use the following command.

sudo aptitude install gtk2hs-buildtools

Summary

In this tutorial we learn how to fix gtk2hsTypeGen command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.