Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-02-2010, 12:38 AM   #1
Bodhi Developer
Registered: Jan 2009
Location: Bloomington, IL
Distribution: Bodhi
Posts: 309

Rep: Reputation: 33
Installing software to /opt

Howdy All,

I was wondering is there a way I can install/configure an application to /opt instead of /usr or /usr/local like many do by default? I am most interested in install .deb packages in this manner how ever I am willing to compiling things from source if need be.

Old 01-02-2010, 02:55 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
I really wouldn't recommend deviating from well established standards to do something like this. /opt is largely where monolithic packages go, stuff which hasn't been developed to properly integrate into a Linux filesystem due to being too large and self contained, like much enterprise level server software, or stuff that's just been badly ported from other unices or windows. If you install conventional software under /opt then other system paths relating to manpages, shared libraries and such will not be found on existing configured paths and not work in a normal way. Most software integrates into /usr for good reasons, don't rock the boat for no good reason.
Old 01-02-2010, 05:48 AM   #3
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
I use /opt strictly for things that are NOT installed with the package manager.

Two rules for any distro's package manager:
1. Always use it if at all possible.
2. Don't mess around with how it does things unless:
---a. You have a really good reason.
---b. You really know what you are doing

Old 01-02-2010, 10:13 AM   #4
Bodhi Developer
Registered: Jan 2009
Location: Bloomington, IL
Distribution: Bodhi
Posts: 309

Original Poster
Rep: Reputation: 33
Originally Posted by pixellany View Post
---a. You have a really good reason.
I am installing Software on my Nokia N900 which runs Maemo 5, which only has a 100meg root partition, all the default software installs to /opt however Maemo works with Debian packages (but they installed to /usr by default) so I want to move them to install to /opt to my tiny root partition is no longer full.

I realize it is non-standard but this is how the device is setup. Suggestions?

Old 01-02-2010, 12:50 PM   #5
Registered: Mar 2007
Distribution: Debian
Posts: 547

Rep: Reputation: 67
as pixellany said, I use /opt for separating the distribution provided packages from third party software, which I always install from source. This method also allows to have more than one version of the same lib installed.

I can't say anything to the nokia phone, but in order to install to opt, you would just give configure the prefix (--prefix=/opt/usr). Further you need to need to specify the path to the libs (echo "/opt/usr/lib" >> /etc/ ; ldconfig) and adjust your $PATH.
In order to install .deb packages to a different location you would need to create a new package.
Old 01-02-2010, 01:01 PM   #6
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
The /usr/local/ hierarchy is intended to be used for software you install yourself that is not installed by the package manager. It is guaranteed that your distro will not use this directory. This isn't true for /opt, so /usr/local is a better place. Also /usr/local/ is a hierarchy like /usr with it's own bin/, sbin/, lib/, etc. standard directories that all /usr/local/ prefixed applications share. In /opt/ on the other hand each package may have it's own subdirectory for binaries, libraries, documentation and data. Opt/ is intended for complex subsystems such as java or a newer version of KDE. You will need to configure more than the prefix to run your software installed there. This will have to be done each time you install a package here.

To use /opt/ or /usr/local/ as the installation root for programs you compile from source, set the "prefix" and maybe also the "exec-prefix" variable when running the configure script. See "./configure --help" for more details on your particular project. You can change other path defaults as well.

Whether you use /usr/local/ or /opt/ for the prefix, you will need to check that your executable, library, and manpage paths are configured properly. The paths may need to be configures just once for /usr/local/, but you want/need to update them (e.g. run ldconfig) after installing a new program under /usr/local/.

Last edited by jschiwal; 01-02-2010 at 01:09 PM.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Where to install software /opt? or /usr/local? sfwalter Linux - General 4 08-24-2013 12:22 AM
Regarding # /opt/CTEact/bin/act & /opt/SUNWexplo/bin/explorer not available for x86 rajaniyer123 Solaris / OpenSolaris 6 04-24-2008 10:09 AM
RPM: installing package openssl-0.9.7d-2 needs 10Mb on the /opt filesystem ? fluppi AIX 3 01-19-2006 11:32 AM
Use of /opt monz Linux - General 3 05-13-2004 09:56 AM
opt software, file hierarchy & prep. packages pross AIX 1 04-14-2004 02:33 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration