LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Problem with installing cheat program. (https://www.linuxquestions.org/questions/linux-software-2/problem-with-installing-cheat-program-4175668570/)

validator456 01-28-2020 05:09 AM

Problem with installing cheat program.
 
The program cheat allows you to create and view interactive cheatsheets on the command-line.
I downloaded and placed the executable file cheat-linux-amd64 in /usr/local/bin.
I then made it executable with: sudo chmod +x cheat-linux-amd64
I then typed in the command:
Quote:

sudo mkdir -p ~/.config/cheat && cheat --init > /.config/cheat/conf.yml
The result is:
bash: /home/porter/.config/cheat/config.yml - Permission denied.

What is the reason of this error message?

Installation instructions for cheat: https://github.com/cheat/cheat

Geist 01-28-2020 05:14 AM

You forgot the tilde in the last path.
/.config/cheat/conf.yml

/ = Filesystem root, which you probably don't have write permissions for, but the folder probably doesn't even exist at that spot, to begin with.

validator456 01-28-2020 05:23 AM

I copied the command
Quote:

sudo mkdir -p ~/.config/cheat && cheat --init > ~/.config/cheat/conf.yml
from this page: https://github.com/cheat/cheat

I don't know why the tilde disappeared. I tried it again. With the tilde, and I get the same error.

Geist 01-28-2020 05:31 AM

Quote:

Originally Posted by validator456 (Post 6083719)
I copied the command


from this page: https://github.com/cheat/cheat

I don't know why the tilde disappeared. I tried it again. With the tilde, and I get the same error.

Ohh, if you didn't install it through your package manager then you also quite likely need to give the file the executable flag.
Modify the path here to reflect where cheat is on your system.

Code:

chmod +x  /location/of/cheat
Edit: Sorry, misplaced whitespace.

validator456 01-28-2020 05:56 AM

I did that. See first post.

linom 01-28-2020 06:43 AM

Quote:

Originally Posted by validator456 (Post 6083716)
The program cheat allows you to create and view interactive cheatsheets on the command-line.
I downloaded and placed the executable file cheat-linux-amd64 in /usr/local/bin.
I then made it executable with: sudo chmod +x cheat-linux-amd64
I then typed in the command:


The result is:
bash: /home/porter/.config/cheat/config.yml - Permission denied.

What is the reason of this error message?

Installation instructions for cheat: https://github.com/cheat/cheat

Have you done this:
Quote:

export CHEAT_CONFIG_PATH="~/.dotfiles/cheat/conf.yml"

crts 01-28-2020 10:39 AM

Quote:

Originally Posted by validator456 (Post 6083716)
I then typed in the command:
Code:

sudo mkdir -p ~/.config/cheat && cheat --init > /.config/cheat/conf.yml
The result is:
bash: /home/porter/.config/cheat/config.yml - Permission denied.

The bold part executes as root, thus the resulting directory ~/.config/cheat is owned by root. The italic part is executed as normal user who does not have read/write permission to the previously created directory.
This demonstrates what I mean:
Code:

$ sudo whoami && whoami
root
user
$

Delete the folder created by root and run mkdir and cheat as normal user:
Code:

sudo rm -rf ~/.config/cheat
mkdir -p ~/.config/cheat && cheat --init > /.config/cheat/conf.yml

There is no sudo required in the instructions you linked.

validator456 02-07-2020 01:10 AM

Okay, I will check it out, thank you.


All times are GMT -5. The time now is 03:05 PM.