Ask Your Question
1

how to change a location of installed program

asked 2014-10-20 06:01:26 -0500

siva gravatar image

updated 2014-10-20 13:32:45 -0500

mether gravatar image

Hi,

how can i change the location of installed program .

Thank you

edit retag flag offensive close merge delete

Comments

1

Installed with yum or with make install?

skytux gravatar imageskytux ( 2014-10-20 09:42:47 -0500 )edit
1

add some more details in your question

pnemade gravatar imagepnemade ( 2014-10-20 11:22:06 -0500 )edit
1

Thank you for replying... I have installed with make install. It is automatically installed in /usr/local/bin . I wanted to change that location. The program I wanted to change isgo-perl-0.15. Thank you

siva gravatar imagesiva ( 2014-10-21 01:35:31 -0500 )edit

Welcome to Ask Fedora! Please take a moment to read the forum guidelines here: http://tinyurl.com/askfedora-guidelines

FranciscoD_ gravatar imageFranciscoD_ ( 2014-10-21 17:14:13 -0500 )edit

2 Answers

Sort by » oldest newest most voted
2

answered 2014-10-21 13:07:27 -0500

sgallagh gravatar image

updated 2014-10-21 14:50:28 -0500

You probably want to carefully select the set of options that you pass to the configure script when building.

Assuming you are using an autotools-based project, you will want to call configure this way:

./configure \
        --build=$(uname -m)-unknown-linux-gnu \
        --host=$(uname -m)-unknown-linux-gnu \
        --program-prefix= \
        --prefix=/usr \
        --exec-prefix=/usr \
        --bindir=/usr/bin \
        --sbindir=/usr/sbin \
        --sysconfdir=/etc \
        --datadir=/usr/share \
        --includedir=/usr/include \
        --libdir=$(rpm --eval %{_libdir}) \
        --libexecdir=/usr/libexec \
        --localstatedir=/var \
        --sharedstatedir=/var/lib \
        --mandir=/usr/share/man \
        --infodir=/usr/share/info

(This is the way that RPM builds call configure as well; you can see this with 'rpm --eval %configure')

If you're using a cmake-based build, you can try:

/usr/bin/cmake \
        -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \
        -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \
        -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \
        -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
        -DCMAKE_INSTALL_PREFIX:PATH=/usr \
        -DINCLUDE_INSTALL_DIR:PATH=/usr/include \
        -DLIB_INSTALL_DIR:PATH=$(rpm --eval %{_libdir}) \
        -DSYSCONF_INSTALL_DIR:PATH=/etc \
        -DSHARE_INSTALL_PREFIX:PATH=/usr/share \
        -DLIB_SUFFIX=64 \ # Only on 64-bit systems
        -DBUILD_SHARED_LIBS:BOOL=ON
edit flag offensive delete link more

Comments

To add to this - once you've installed software in a certain location using make; make install, you cannot generally move it easily - you need to uninstall it and reinstall it to a new location. Uninstall is sometimes as simple as make uninstall, but can be a lot more complex, depending on how well the autotools project files were written.

To avoid all this, we generate rpms for all the software we use - to make it easy to install/remove. Of course, this requires some work, but when the package is ready, it makes things much simpler.

FranciscoD_ gravatar imageFranciscoD_ ( 2014-10-21 17:13:13 -0500 )edit
0

answered 2014-10-21 09:13:52 -0500

skytux gravatar image
make install DESTDIR=/path/to/install/dir

HTH,

Germán.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-10-20 06:01:26 -0500

Seen: 259 times

Last updated: Oct 21 '14