when I do a 'make install' it does not create Directory

20.3k Views Asked by At

This is my first attempt with autoconf, I changed and added some different code to a utility then I took the make.am and other files I needed, I modified them to work with what I wrote, into the same program. as it worked with that one, all I needed to change was the name and version and main.c and header file names. When I do, configure, then, make, it all goes well. it is when I get to the "make install" then I get this error, and I am not sure why.

Making install in src
make[1]: Entering directory `/home/userx/Dropbox/mhsetroot-MAKE/src'
make[2]: Entering directory `/home/userx/Dropbox/mhsetroot-MAKE/src'
/bin/bash ../config/mkinstalldirs /usr/local/bin
/usr/bin/install -c mhsetroot /usr/local/bin/mhsetroot
/usr/bin/install: cannot create regular file `/usr/local/bin/mhsetroot': Permission denied
make[2]: *** [install-binPROGRAMS] Error 1
make[2]: Leaving directory `/home/userx/Dropbox/mhsetroot-MAKE/src'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/userx/Dropbox/mhsetroot-MAKE/src'
make: *** [install-recursive] Error 1

it does not let it make a directory. So, I tired it.

mkdir /usr/local/bin/mhsetroot

I get the same error, therefore it is just a permissions problem, right ? If that is all that it is, then it should work on someone else's computer, just not mine? Also, then what permissions do I need to have set on my "local/bin" so that the "make install" will work without having to be in "sudo" mode first?

3

There are 3 best solutions below

1
On

I get the same error, therefore it is just a permissions problem, right ?

Right. It cannot create /usr/local/bin/mhsetroot.

If that is all that it is, then it should work on someone else's computer, just not mine?

It depends on what the permissions of /usr/local/bin is.

Also, then what permissions do I need to have set on my "local/bin" so that the "make install" will work without having to be in "sudo" mode first?

It depends on what the permissions of /usr/local/bin is. Usually you will need root permission to install there (e.g. sudo make install). Alternately, you can set DESTDIR for make install:

make DESTDIR=/some/writable/path install

but that also might need more setup, too (e.g. LD_LIBRARY_PATH).

0
On

make && make install is not a single command, it is two.
sudo make && install will execute make as superuser, but the && part is telling make install to wait until the first part has completed. 'make install' is it's own command, so what you need is:

sudo make && sudo make install  

This is what I needed to do on slackware to get efl to build. I had exactly the same error as OP (searching it brought me here).

A more common example is

sudo apt update && sudo apt upgrade  

where these are more commonly written as 2 lines without the '&&'. You have to sudo both parts.

0
On

Try doing it with sudo make install command as you need to have root access for this. So instead of typing make install in command, whenever you get permission error, try putting sudo in beginning of command and then enter the root password. It works. :)