Git Clone "fatal:
I'm trying to install yay, so I made a directory and in that directory I wrote the command
git clone https://aur.archlinux.org/yay.git
and I get back
fatal: could not create work tree dir 'yay' : Permission denied
I have googled alot, and I couldn't find really anything that worked for me.
I am really new to linux, and it worked on my Arch installment right before this one, and now when I tried to go thourg it again (so I know how to do it before I install it on my computer for reals) on Virtualbox, it didn't work.
edit: I tried it with a user under the wheel group, it has a $ before it.
About this post
- Posted
- Archived
- Score
- 0 · 100% up
- Kind
- Text
- ID
- b92fim
35 comments
My guess is that you created the directory as root and are now trying to run
git cloneas your normal user, where onlyroothas permissions to write to the directory.I just figured out that I made it again with sudo... And that I cant make directories without using sudo command, and that makes it root permission. I get so confused by all this tryin to wrap my head around this.
That just means you don't have permissions in the directory you're creating your subdirectories in, either. What directory are you trying to work in?
yeah, I thought that also. So I erased the directory as root and then I logged in with the non root user and mkdir a new folder. And, still the same problem.
Can you post a screenshot of the exact commands you're running and the outputs?
Based on the image you provided: https://imgur.com/xpWaB9q
As a regular user you are not allowed to write anywhere als than your home folder and it's subfolders1. Your homefolder is normally
/home/YourUsername, mostly indicated as~. You are trying to write somewhere else in your rootfolder (/). Change to your homefolder (just typingcdshould do that) and try again. You won't need a programs folder. When you install a package through pacman ormakepkg -siit will be installed in the correct directory, mostly/usr/bin.1: You are allowed to some other directories like
/tmpfor example and you can set permission and ownership to directories withchownandchmodto be allowed to write to them, but usually you don't have to do this. Just stick to your homefolder.yeah, I try to do that, it dosent work. Just get the same problem.
fatal: could not create work tree dir 'yay' : Permission denied
Did you read the this? https://wiki.archlinux.org/index.php/General_recommendations#System_administration
Did you add a new user? https://wiki.archlinux.org/index.php/Users_and_groups#User_management
Ifs not follow the instructions in the wiki, logout and login with new username and password
Try chmodding the directory. Something like chmod 644 or chown it
I will look up what chmodding is!
Why are you installing Arch? If you're having this much trouble with basic permissions, you're going to have a bad time. You'd be better off with Ubuntu or Mint.
Looks like you have made a folder as root, and therefore dont have write perms to the folder.
Do the following
Do not be logged in as root
mkdir ~/programs
cd ~/programs
git clone thing
What does the ~ mark do? Iv'e seen it been used before. I'm sorry if I ask questions that are extremely noob like.
~ is a "shortcut" to the active users /home/ directory
Type 'pwd' in the directory you're working in, and share the output of that with us.
Also, type in 'echo $USER'.
Finally, if you can, go to the parent directory ('cd ..') and type 'ls -a' for us.
If you do this, we should be able to narrow it down significantly
Add yourself to a git group