0

I'm new to Linux/Rasperry Pi and I was following this tutorial to create a native build of Qt. I got up to the ./configure step. But this gives me the error:

bash: ./configure Permission denied

I think it has something to do that I want to run the configuration from a USB drive (as instructed in the tutorial). How can I get this to work?

  • I had the exact same problem, following the same tutorial! Can you tell me how your usb drive is formatted? If it is not formatted in ext3/ext4, then try doing so – user34421 Sep 5 '15 at 18:24
1

You need to understand how unix modes and permissions, used on POSIX operating systems such as GNU/Linux and OSX work, otherwise your life is going to be full of awkward problems like this. There are already lots and lots of introductions online, I will not bother regurgitating them.

However, I'll give an example of applying the concepts in this case. First, you need to know some id numbers for your current user:

id $(whoami)

Will give you your uid, gid, and a list of groups whose permissions you can use.

./configure is a file. To get the modes and permissions set on it:

stat ./configure

It's in the first line labelled "Access:" (there are two), and will be something like 0755/drwxr-xr-x. All of those links from above explain how to decipher that. See also man stat.

You need to change the ownership on the whole directory tree, since you are going to be building software in it. For that you can use the -R (recursive) switch to chown (see also man chown), but you need privileges to do so, via sudo. Presuming you are in the same directory as the configure file, and you are user pi:

sudo chown -R pi.pi .

You could of course just do sudo ./configure and proceed that way, but this way you are playing safe. On the other hand, if you are intending to do a system wide install, you will need to do so at some point (sudo make install).


Note that this is not necessarily an ownership problem, which will be obvious when you examine the files in question; it can also be purely mode related. To execute a file, it needs to be set as executable (adds 1 to the mode, e.g., 7 is read/write/execute, 6 is read/write, 5 is read/execute, 4 is just read). It would be a bit bizarre in this case, but certainly not impossible depending on how the source archive was unpacked and the USB drive mounted.

| improve this answer | |
  • I appreciate your detailed answer but sudo ./configure was the first thing I tried. This gives me sudo ./configure: command not found: – testus Aug 23 '15 at 17:44
  • stat ./configure tells me I have the permission 0644. Right click on the file say "Execute: Nobody" and I can't seem to change it – testus Aug 23 '15 at 17:48
  • Looks like it's not executable, which is kinda weird. I've added a last paragraph about this. I suggest you ask a more detailed version of this question on our larger sibling site Unix & Linux, since the brand of hardware is really irrelevant here. By "more detailed", I mean including the fact that you used sudo, that ./configure has ended up 644, and exactly how the USB stick was mounted (if it was automounted and use a default Raspbian configuration, say, "automounted by LXDE"). – goldilocks Aug 23 '15 at 18:11
  • I should rephrase that. You want to find out exactly why .configure might end up non-executable. I don't think they would ship the package that way, and there may be other files with the wrong mode which will cause other problems. Since the instructions included using mount --bind, check and see if the mode/permissions are identical in both places. – goldilocks Aug 23 '15 at 18:16
  • Ok I will probably post a Question on the Unix & Linux site. FYI, I mounted the USB exactly how it was described in the linked tutorial. Also, afaik all the files in the mounted folder are set to be non-executable for some reason – testus Aug 23 '15 at 18:18

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.