Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make install, but not to default directories?

People also ask

How do I change the installation directory in Linux?

The installation path is a standard location and cannot be changed. If you have another drive that has space, you can move any amount of your files to that drive by mounting your big directories at partitions on that drive (this is easiest to do when you are first installing Ubuntu).

Where does make install put files?

There is no rule but usually /usr/local (i.e., /usr/local/bin for binaries). will install the software in your home directory. Show activity on this post. Further to Matteo's answer, you can examine the Makefile to see where a particular program is going to install.

How do I install a package in a specific directory in Linux?

So, execute the installation command with the –releasever=/ option. Type 'y' for granting additional disk space usage and begin the installation process of the package you want to install. In the above screenshot attached, you can witness the installation of Git in the /opt/temp-packages directory.


It depends on the package. If the Makefile is generated by GNU autotools (./configure) you can usually set the target location like so:

./configure --prefix=/somewhere/else/than/usr/local

If the Makefile is not generated by autotools, but distributed along with the software, simply open it up in an editor and change it. The install target directory is probably defined in a variable somewhere.


Since don't know which version of automake you can use DESTDIR environment variable.
See Makefile to be sure.

For example:

 export DESTDIR="$HOME/Software/LocalInstall" && make -j4 install

make DESTDIR=./new/customized/path install

This quick command worked for me for opencv release 3.2.0 installation on Ubuntu 16. DESTDIR path can be relative as well as absolute.

Such redirection can also be useful in case user does not have admin privileges as long as DESTDIR location has right access for the user. e.g /home//


It could be dependent upon what is supported by the module you are trying to compile. If your makefile is generated by using autotools, use:

--prefix=<myinstalldir>

when running the ./configure

some packages allow you to also override when running:

make prefix=<myinstalldir>

however, if your not using ./configure, only way to know for sure is to open up the makefile and check. It should be one of the first few variables at the top.