You are not logged in.

#1 2020-09-23 16:16:14

SkyBoy
Member
From: Iran
Registered: 2020-09-23
Posts: 13

You do not have write permission

Hi Again
im going too install vscode with GIT So

git clone https://aur.archlinux.org/visual-studio-code-bin.git
[amirsky@skyboy Downloads]$ cd visual-studio-code-bin/
amirsky@skyboy visual-studio-code-bin]$ makepkg -s
==> ERROR: You do not have write permission for the directory $BUILDDIR (/home/amirsky/Downloads/visual-studio-code-bin).
    Aborting...

Offline

#2 2020-09-23 16:21:20

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,648

Re: You do not have write permission

What are the permissions on /home/amirsky/Downloads/visual-studio-code-bin?   
Post the output of ls -l /home/amirsky/Downloads/visual-studio-code-bin


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2020-09-23 16:24:52

SkyBoy
Member
From: Iran
Registered: 2020-09-23
Posts: 13

Re: You do not have write permission

thanks for your attention

ls -l /home/amirsky/Downloads/visual-studio-code-bin
total 12
-rw-r--r-- 1 root root 1934 Sep 23 19:27 PKGBUILD
-rw-r--r-- 1 root root  512 Sep 23 19:27 visual-studio-code.desktop
-rw-r--r-- 1 root root  345 Sep 23 19:27 visual-studio-code-url-handler.desktop

Offline

#4 2020-09-23 16:28:34

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,557
Website

Re: You do not have write permission

Why did you do the git clone as root?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2020-09-23 16:32:12

SkyBoy
Member
From: Iran
Registered: 2020-09-23
Posts: 13

Re: You do not have write permission

WorMzy wrote:

Why did you do the git clone as root?

Shouldn't I Have done That???

Offline

#6 2020-09-23 16:34:26

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 636

Re: You do not have write permission

SkyBoy wrote:
WorMzy wrote:

Why did you do the git clone as root?

Shouldn't I Have done That???

No

Please read...
https://wiki.archlinux.org/index.php/Ar … requisites

Edit: Remember when reading commandline in the wiki...

# = root
$ = user

Last edited by Zod (2020-09-23 16:37:10)

Offline

#7 2020-09-23 17:16:49

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,648

Re: You do not have write permission

Just to pull this all together, you always build AUR packages as your regular user.  Doing so as root will fail by design.
As root owned that entire directory structure, your user did not have the rights to change it.   Remove it (with  root permissions).  Reclone, build as your user.  Then install the new package with pacman -U with root permissions.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#8 2020-09-23 20:49:48

SkyBoy
Member
From: Iran
Registered: 2020-09-23
Posts: 13

Re: You do not have write permission

ewaller wrote:

Just to pull this all together, you always build AUR packages as your regular user.  Doing so as root will fail by design.
As root owned that entire directory structure, your user did not have the rights to change it.   Remove it (with  root permissions).  Reclone, build as your user.  Then install the new package with pacman -U with root permissions.

Hi,I removed that file and i going too clone link with user type answer me this:

[amirsky@skyboy Programs]$ git clone https://aur.archlinux.org/nordvpn-bin.git
fatal: could not create work tree dir 'nordvpn-bin': Permission denied

then i use sudo too give permission so:

amirsky@skyboy Programs]$ sudo git clone https://aur.archlinux.org/nordvpn-bin.git
Cloning into 'nordvpn-bin'...

then i going too normal way

[amirsky@skyboy Programs]$ cd nordvpn-bin/
[amirsky@skyboy nordvpn-bin]$ sudo makepkg -si
==> ERROR: Running makepkg as root is not allowed as it can cause permanent,
catastrophic damage to your system.
[amirsky@skyboy nordvpn-bin]$ sudo makepkg -s
==> ERROR: Running makepkg as root is not allowed as it can cause permanent,
catastrophic damage to your system.

I do not know where I did this step wrong

Offline

#9 2020-09-23 20:52:02

loqs
Member
Registered: 2014-03-06
Posts: 18,938

Re: You do not have write permission

In the directory you executed those commands what is the output of

stat .

Offline

#10 2020-09-23 20:56:08

SkyBoy
Member
From: Iran
Registered: 2020-09-23
Posts: 13

Re: You do not have write permission

loqs wrote:

In the directory you executed those commands what is the output of

stat .

Hi

[amirsky@skyboy nordvpn-bin]$ stat .
  File: .
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 804h/2052d      Inode: 801153      Links: 3
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-09-24 00:11:41.811461398 +0330
Modify: 2020-09-24 00:11:32.758127538 +0330
Change: 2020-09-24 00:11:32.758127538 +0330
 Birth: 2020-09-24 00:11:31.321460787 +0330

Offline

#11 2020-09-23 20:57:18

loqs
Member
Registered: 2014-03-06
Posts: 18,938

Re: You do not have write permission

The directory is owned by root:root and other does not have write permission for it.
Edit:
You need to perform the clone in a directory your user has write permissions to.  That should be the case for every directory in your users home directory.
Unless permissions were altered by use of sudo e.t.c..

Last edited by loqs (2020-09-23 21:02:39)

Offline

#12 2020-09-23 21:02:09

SkyBoy
Member
From: Iran
Registered: 2020-09-23
Posts: 13

Re: You do not have write permission

loqs wrote:

The directory is owned by root:root and other does not have write permission for it.

What should I do now?
do you mean i use

chmod 777 File_name

Last edited by SkyBoy (2020-09-23 21:03:43)

Offline

#13 2020-09-23 21:03:46

loqs
Member
Registered: 2014-03-06
Posts: 18,938

Re: You do not have write permission

See my edit.  What is the full path of that directory?

realpath .

Edit:
No you do not need to use chmod 777.

Last edited by loqs (2020-09-23 21:05:35)

Offline

#14 2020-09-23 21:06:51

SkyBoy
Member
From: Iran
Registered: 2020-09-23
Posts: 13

Re: You do not have write permission

loqs wrote:

See my edit.  What is the full path of that directory?

realpath .

Edit:
No you do not need to use chmod 777.

That's Work Thanks a lot<3
i use

chmod a+w File_name

Offline

#15 2020-09-23 21:08:38

loqs
Member
Registered: 2014-03-06
Posts: 18,938

Re: You do not have write permission

If the directory was under your home directory that was the wrong fix.

Offline

#16 2020-09-23 21:12:07

SkyBoy
Member
From: Iran
Registered: 2020-09-23
Posts: 13

Re: You do not have write permission

loqs wrote:

If the directory was under your home directory that was the wrong fix.

ahh how can i use

realpath

i dont know what is this sad

Offline

#17 2020-09-23 21:19:20

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 636

Re: You do not have write permission

realpath . <===There is a period here

Offline

#18 2020-09-23 22:32:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,466
Website

Re: You do not have write permission

Let's stop playing "battleship" to try to infer information and let's just look at the OP's boats.  SkyBoy, please post any output from the following command run as your regular user (and without sudo):

find $HOME ! -user $USER

There generally* should be no ouput from that command.  In your case, there will be some - the real question is how much (to see how pervasive of a problem there is).

The original source of the problem is almost certainly an indescriminate use of `sudo` when it should not be used.

(*note: I say generally there should be no output from this command.  Exceptions will exist on some user's systems (I have one), but such users would know exactly why they have an exception).

Last edited by Trilby (2020-09-23 22:36:23)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#19 2020-09-24 08:18:07

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: You do not have write permission

SkyBoy wrote:

then i use sudo too give permission so:

amirsky@skyboy Programs]$ sudo git clone https://aur.archlinux.org/nordvpn-bin.git
Cloning into 'nordvpn-bin'...

....
I do not know where I did this step wrong

You were explicitly told not to clone as root. Have you read the Wiki on how to use the AUR? https://wiki.archlinux.org/index.php/Ar … Repository

This is pretty basic Linux permissions stuff that a competent Linux user should be able to manage themselves. How did you install Arch?

Offline

#20 2020-09-24 09:40:07

Khere
Member
From: Italy
Registered: 2020-03-04
Posts: 170

Re: You do not have write permission

You have no permission to write and change in Download directory:
Use chown command to change the owner of the directory and add write permission to your normal user.

sudo chown $USER ~/Downloads
chmod +rw ~/Downloads

But i don't understand why you clone the repo with root permission despite it beign written everywhere that you must not do that.

Last edited by Khere (2020-09-24 09:43:23)


Fan of Giorgio Moroder & Mohammad Ammax enemy

Offline

#21 2023-07-15 18:03:02

Nulliferbones
Member
Registered: 2023-07-15
Posts: 16

Re: You do not have write permission

Khere wrote:

You have no permission to write and change in Download directory:
Use chown command to change the owner of the directory and add write permission to your normal user.

sudo chown $USER ~/Downloads
chmod +rw ~/Downloads

But i don't understand why you clone the repo with root permission despite it beign written everywhere that you must not do that.

sorry for reviving an old thread, but I just wanted to let you know you saved my ass in a different situation. Thanks for being direct and clear

Offline

#22 2023-07-15 22:15:35

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,557
Website

Re: You do not have write permission

Mod note: closing this old thread.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB