stack command not found

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

Introduction

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

stack: command not found

or when using sudo you get the following error message

sudo: stack: command not found

Solutions to stack: command not found

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

In Ubuntu stack is provided by haskell-stack package.

haskell-stack is:

Stack is a program for developing Haskell projects. It is aimed at Haskellers both new and experienced.

It features:

  • Installing GHC automatically.

  • Installing packages needed for your project.

  • Building your project.

  • Testing your project.

  • Benchmarking your project.

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

sudo apt-get -y install haskell-stack

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

You can also use apt command to install haskell-stack.

sudo apt -y install haskell-stack

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

sudo aptitude install haskell-stack

Summary

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