1

(This is all in the command line/prompt) Hi!

So, my problem is MOST BASIC in nature, and it's like this:

If I want, for an example, to install and run 'cowsay' -program, I assume I do it like:

sudo apt-get install cowsay

BUT now, if I just try to use it, like:

cowsay "Cow goes moo"

I get: command not found

So, ok, maybe the program is not installed..?

So I type:

dpkg -L cowsay

And, no, it is installed alright, maybe it's just not registered into some default library cache of programs...(if that even is a thing)?

In short, I have no idea how to proceed. The objects listed via dpkg are a lot of files with .cow -format, a few .gz -packages and a README file, aka no .exe .bin executables that I can find. The readme file has, as far as I can tell, nothing of use. It's just copyright information and short history of the program.

Thank you for your time! :)

George Udosen
  • 35,970
  • 13
  • 99
  • 121
Antenni
  • 11
  • 1
  • 1
  • 3
  • 3
    Please run `which cowsay` and let me see the output! – George Udosen Oct 11 '17 at 13:12
  • Hi! When I type: `root@l4126:/# which cowsay` It just gives me: `root@l4126:/#` As in empty line. Sorry, I am having some issues with posting actual screen-captures. – Antenni Oct 11 '17 at 13:20
  • 1
    cowsay is supposed to be in the `/usr/games/` folder. Check `echo $PATH` and see if that folder is in your path. – Terrance Oct 11 '17 at 13:23
  • So it isn't installed, try re-install! – George Udosen Oct 11 '17 at 13:29
  • Run `sudo dpkg -l cowsay` and post the results into your question. – George Udosen Oct 11 '17 at 13:34
  • Sorry for the delay, I am still learning the interface. But this is what that path looks like, so this is not installed? I am very confused. :/ ![Screen Capture](https://i.imgur.com/pORm1Oe.jpg) – Antenni Oct 11 '17 at 13:34
  • 1
    please run `echo $PATH | grep /usr/games` and post the result let see it's your path – George Udosen Oct 11 '17 at 13:37
  • Ok! [This is what it gives](https://i.imgur.com/zc96WC1.jpg) – Antenni Oct 11 '17 at 13:40
  • 1
    cowsay is definitely installed. You need to add the `/usr/games/` to your path. One way to try this out is to run a command `PATH=$PATH:/usr/games` from the terminal then try to run cowsay. This is not permanent, it is just a test. – Terrance Oct 11 '17 at 13:41
  • Ok, it seems to work that way! [pic](https://i.imgur.com/vSpzPc5.jpg) Thank you! :) – Antenni Oct 11 '17 at 13:43

1 Answers1

3

Generally when you install a program, you will be able to run it from the command line by typing the name of the program installed. Note that this name will not always match the name of the package (e.g. alsa-tools provides as10k1, hda-verb, sbiload and us428control).

As discussed in the comments by George and Terrance, the program must also be in your PATH variable so that you don't require the full path to run it. For some reason "cowsay" is not, so you can temporarily add it as described by Terrance using:

PATH=$PATH:/usr/games

If this works, you can permanently add this location to your path variable. This can be done by modifying .profile, .pam_environment, or other locations as described in the references below. For example, adding the following to ~/.profile should work:

export PATH="$PATH:/usr/games"

The above will take effect on the next login.

References:

DougC
  • 233
  • 1
  • 7