1

When I enter the following command in my mac OSX terminal i get a "permission denied" error even though I have administrative privileges.

Command:

administrators-Mac-mini-2:Build Foldername sarwan$ ./dpkg-scanpackages -m . /dev/null --> Packages

Error:

-bash: ./dpkg-scanpackages: Permission denied

EDIT: The Build I am trying to make is for an ios project thats why I included the iphone tag.I don't know if that helps or not.

EDIT 2 Thanks Gryphius your answer is correct.

  • 2
    check if the file dpkg-scanpackes is executable – Gryphius Dec 20 '12 at 12:07
  • @Gryphius write your answer in the answers section so that I can choose it as the correct Answer. – IosBoy Dec 20 '12 at 12:33
3

if a file is not executable you get this error even with administrative privileges. make your script executable and it should work

[root@boscos gryphius]# echo 'echo hello world!' > mytestscript.sh
[root@boscos gryphius]# ./mytestscript.sh
bash: ./mytestscript.sh: Permission denied
[root@boscos gryphius]# chmod 755 mytestscript.sh 
[root@boscos gryphius]# ./mytestscript.sh 
hello world!
0

Despite being logged in with administrative privileges, you usually need to use sudo at least once before you are granted these privileges through terminal (at least thats what I've found).

Try "sudo Build SGService sarwan$ ./dpkg-scanpackages -m . /dev/null --> Packages"

-Nick

  • I rather think sudo should be put in front of the real command, not in front of the prompt (which is, admittedly, not separated in a very readable way)... – glglgl Dec 20 '12 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.