LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 01-01-2010, 11:38 PM   #1
Jeff91
Bodhi Developer
 
Registered: Jan 2009
Location: Alsip, IL
Distribution: Bodhi and Maemo
Posts: 297

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.

Regards,
~Jeff
 
Old 01-02-2010, 01:55 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
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, 04:48 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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

......Really!!
 
Old 01-02-2010, 09:13 AM   #4
Jeff91
Bodhi Developer
 
Registered: Jan 2009
Location: Alsip, IL
Distribution: Bodhi and Maemo
Posts: 297

Original Poster
Rep: Reputation: 33
Quote:
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?

Regards,
~Jeff
 
Old 01-02-2010, 11:50 AM   #5
almatic
Member
 
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/ld.so.conf ; 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, 12:01 PM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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 12:09 PM.
 
  


Reply

Tags
installing


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-23-2013 11:22 PM
Regarding # /opt/CTEact/bin/act & /opt/SUNWexplo/bin/explorer not available for x86 rajaniyer123 Solaris / OpenSolaris 6 04-24-2008 09:09 AM
RPM: installing package openssl-0.9.7d-2 needs 10Mb on the /opt filesystem ? fluppi AIX 3 01-19-2006 10:32 AM
Use of /opt monz Linux - General 3 05-13-2004 08:56 AM
opt software, file hierarchy & prep. packages pross AIX 1 04-14-2004 01:33 PM


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

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