Linux - SoftwareThis 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.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.
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.
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
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?
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.
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/.