I'm trying to install something and it's throwing me an error: Permission denied when I try to run make on it.
I'm not too fond of the universal rules of unix/linux and not too fond of user rights either. My best guess is that the user I'm logged in as does not have the privileges to run make commands, but hopefully it's something else that's not permitting me to install. Why do I get Permission denied and what should I check or configure in order to attempt permission be granted? EDIT 2 down vote favorite Error Message:
gcc -I. -O3 -o pp-inspector pp-inspector.c make: execvp: gcc: Permission denied make: [pp-inspector] Error 127 (ignored) gcc -I. -O3 -c tis-vnc.c -DLIBOPENSSL -DLIBOPENSSLNEW -DLIBIDN DHAVE_PR29_H -DLIBMYSQLCLIENT -DLIBPOSTGRES -DHAVE_MATH_H I/usr/include/mysql make: execvp: gcc: Permission denied make: *** [tis-vnc.o] Error 127
linux command-line permissions make asked Feb 2 '12 at 2:53 share|improve this question edited Feb 2 '12 at 3:02 CheeseConQueso 2,339115195 you run as sudo? Book Of Zeus Feb 2 '12 at 2:55 i tried, but got the same error as in the first comment to Jarryd's answer CheeseConQueso Feb 3 '12 at 3:44 add comment
4 Answers
active oldest votes On many source packages (e.g. for most GNU software), the building system may know about the DESTDIR make variable, so you can often do:
make install DESTDIR=/tmp/myinst/
up vote 4 down sudo cp -va /tmp/myinst/ / vote accepted The advantage of this approach is that make install don't need to run as root, so you cannot end up with files compiled as root (or root-owned files in your build tree).
answered Feb 2 '12 at 5:27 share|improve this answer Basile Starynkevitch 59k42562 add comment
Giving us the whole error message would be much more useful. If it's for make install then you're probably trying to install something to a system directory and you're not root. If you have root access then you can run
sudo make install
up or log in as root and do the whole process as root. vote 2 down answered Feb 2 '12 at 2:57 vote share|improve this answer Jarryd 66939 thanks, updated my question and also tried sudo but got the error message ccq is not allowed to run sudo on cpanel03 CheeseConQueso Feb 2 '12 at 3:05 i guess i got the answer to my question now CheeseConQueso Feb 2 '12 at 1 3:05 So it's saying you're not allowed to run gcc. It looks like you're on a cpanel installation, you might not even be allowed to run gcc. Jarryd Feb 2 '12 at 3:36 yeah im on cpanel... is there any other way to "make" the installation? or is that only possible via the command line CheeseConQueso Feb 2 '12 at 4:30 I don't know what your setup is. Are you on a machine that you own or a web host's machine. If you are on your own machine then there is always a way. If you are on a web host who has given you cpanel access to manage your web server then you probably can't install software like that. Jarryd Feb 2 '12 at 5:33 show 1 more comment I had a very similar error message as you, although listing a particular file:
up vote 0 $ make down make: execvp: ../HoughLineExtractor/[Link]: Permission vote denied
make: *** [../HoughLineAccumulator/houghlineaccumulator.o] Error 127
$ sudo make make: execvp: ../HoughLineExtractor/[Link]: Permission denied make: *** [../HoughLineAccumulator/houghlineaccumulator.o] Error 127
In my case, I forgot to add a trailing slash to indicate continuation of the line as shown:
${LINEDETECTOR_OBJECTS}:\ ../HoughLineAccumulator/[Link] slash!! ../HoughLineExtractor/[Link] # <-- missing
Hope that helps someone else who lands here from a search engine. answered Mar 18 '13 at 19:23 share|improve this answer Drew Noakes 60.4k41213292 add comment The problem is frequently with 'secure' setup of mountpoints, such as /tmp If they are mounted noexec (check with cat /etc/mtab and or sudo mount) then there is no permission to execute any binaries or build scripts from within the (temporary) folder. E.g. to remount temporarily:
sudo mounte -o remount,exec /tmp
up vote 0 down vote
Or to change permanently, remove noexec in /etc/fstab