0

I'm really struggling with the different tutorials as I keep getting errors or I keep getting told that what I'm doing isn't recognised as a command so I would really appreciate it if someone could walk me through this. I've been trying to install HaskellToolStack because I think it's something I need? I don't know, I'm starting university soon and they suggested that learning some Haskell before starting is a good idea. Near the end of my installation I get this message in my terminal.

Stack has been installed to: /usr/local/bin/stack

WARNING: '/home/kester/.local/bin' is not on your PATH. For best results, please add it to the beginning of PATH in your profile.

And I've tried to follow the tutorials and have found no success so I would really appreciate it if someone could just tell me step by step what I should type into my terminal

Retsek
  • 155
  • 1
  • 2
  • 10

2 Answers2

2

The relevant lines

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

in the file ~/.profile should already exist. Just run the command

source "$HOME/.profile"

and you're done. You'll have to do that only once since you just installed HaskellToolStack and the folder ~/.local/bin didn't exist before.

You can check with

echo $PATH

if /home/kester/.local/bin is added to your PATH now.

mook765
  • 15,925
0

If you want to do this in one line, here it is (I assumed your user's name is kester):

echo -e '\nexport PATH="$PATH:/home/kester/.local/bin"' >> /home/kester/.bashrc

You can manually add the contents of echo to the end of .bashrc too.
echo means print. and >> means append instead of rewriting the file.
-e enables backslash escapes.
the \n at the start makes sure we don't add this to the end of the last line instead of a new line.
export changes environment variables. we first get what already in the path ($path) and append what we want to it, then the export PATH part sets the path to the newly created string.
we then add this line to the end of bashrc file which is called every time a bash window opens so it's present in every terminal window.
I'm no expert so there might be better ways to do this but this worked well for me.

mpower
  • 101