LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-12-2013, 08:48 PM   #1
ffffdisk
LQ Newbie
 
Registered: Jan 2013
Posts: 3

Rep: Reputation: Disabled
What circumstances justify the installation of compiled software in "/usr"?


I have to use custom versions of Python, Postgresql and Apache httpd. I have uninstalled them and I will compile them from source, it is a local machine and I am the only user.
I am wondering if due to the importance of the applications I should install them in /usr using /usr/lib64 and /var for the library and state folder.

Thanks
 
Old 01-12-2013, 09:10 PM   #2
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 530

Rep: Reputation: Disabled
Well for the programs that ship with Slackware (that you just want to use a different version of), I would recommend installing them into /usr/local or /opt/<package name> as per the Filesystem Hierarchy Standard. If you install those directly into /usr (where Pat installs them), they may overwrite the files that ship with your Slackware version and cause problems.

I'm not sure about PostgreSQL, but since that doesn't ship with Slackware, that might be okay to install into /usr (don't quote me on this), but I would still install it to /opt/postgresql (personal preference).

Last edited by TommyC7; 01-12-2013 at 09:13 PM.
 
1 members found this post helpful.
Old 01-13-2013, 02:26 AM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
for Apache /var/www but that is just where red hat puts it
 
Old 01-13-2013, 03:29 AM   #4
wigry
Member
 
Registered: Jul 2004
Distribution: slackware
Posts: 225

Rep: Reputation: 53
Also look at possibility to turn your custom compilation into Slackware package where you can later manage it with installpkg/removepkg. There is an utility called src2pkg which allows you to turn source tarball into Slackware package.
 
1 members found this post helpful.
Old 01-13-2013, 03:30 AM   #5
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Personally I install libraries in /usr and everything else in /usr/local. This is to avoid the situation where programs will not find the libraries unless they are in /usr.
 
Old 01-13-2013, 03:53 AM   #6
wigry
Member
 
Registered: Jul 2004
Distribution: slackware
Posts: 225

Rep: Reputation: 53
I instead add /usr/local/lib to my ldconfig.conf or whatever the filename is.
 
Old 01-13-2013, 04:27 AM   #7
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
I tend to do what wigry suggests and build a customised package for anything I am replacing.
 
Old 01-13-2013, 05:21 AM   #8
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by wigry View Post
I instead add /usr/local/lib to my ldconfig.conf or whatever the filename is.
It is /etc/ld.so.conf, and I have added it, but it still may not find the libs. It depends on the build system as well.
 
Old 01-13-2013, 06:17 AM   #9
Martinus2u
Member
 
Registered: Apr 2010
Distribution: Slackware
Posts: 497

Rep: Reputation: 119Reputation: 119
as wigry and GazL have pointed out, best strategy is to use package management, ideally by modifying the original SlackBuild scripts. No harm installing into /usr when under control of package management. When installing manually I heavily recommend using alternative locations just to keep an overview, be it /usr/local, /opt or anything else that taketh your fancy. If the chosen directory represents a separate file system, certain operations down the road become easier (eg. system-reinstall).
 
Old 01-13-2013, 10:21 AM   #10
sahko
Senior Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 1,041

Rep: Reputation: Disabled
No circumstance justifies compiling from source.
The best practice is to use SlackBuilds and create packages, even ones that install in /usr/local or /opt or /home/$USER or whatever.
Even better practice is what SBo does and copy the SlackBuild script used in the documentation directories. That way you can always check how the package you have installed is compiled.

The only exceptions could be binary blobs like nvidia, virtualbox or skype.
 
Old 01-13-2013, 10:29 AM   #11
hitest
Guru
 
Registered: Mar 2004
Location: Canada
Distribution: Void, Debian, Slackware
Posts: 7,342

Rep: Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746
Quote:
Originally Posted by sahko View Post

The only exceptions could be binary blobs like nvidia, virtualbox or skype.
Thankfully the good people at slackbuilds.org do provide a slackbuild script to create a slackware package for skype.
 
Old 01-13-2013, 10:34 AM   #12
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
A good rule of thumb is one that doesn't come back to haunt you -- I long ago learned that add-on software really should live in /usr/local and add-on applications really should live in /opt. The idea being to keep distribution software; i.e., that provided on installation media, be kept "pristine," un-fooled-around-with.

Why? Well, I partition disk drives so that /opt and /usr/local are mounted file systems (among others) and the system partition only contains that software provided on the installation media -- when an update arrives (such as Slackware 14.0 from Slackware 13.37), it is a simple task to do a clean install (after saving certain configuration files off to a separate partition) by simply choosing to format (or create a file system) on the system partition but not doing so on the "local" partitions thus everything in the local partitions remains in place (this is when you're doing setup and adding disk partitions to fstab). Here, "others" include /var/lib/mysql, /var/lib/pssql and /var/lib/virtual -- they remain in place.

I construct a "standard tree" in /usr/local; bin, etc, include, lib, lib64, man, sbin, share, src. This accomplishes two goals: no system files accidentally get overwritten and the "local" stuff is easy to find. When I'm building packages from SlackBuilds.org I modify the packagename.SlackBuild file (if necessary) to install in /usr/local, similarly, if I'm building something from source (with configure-make-make install) using src2pkg, I force src2pkg to install in /usr/local.

It's no trick to add to /etc/ld.so.conf:
Code:
cat /etc/ld.so.conf
/usr/local/lib
/usr/x86_64-slackware-linux/lib
/usr/lib64/seamonkey
Slackware already includes /usr/local/bin on the system PATH environment and it's easy enough to make simple changes to a user .profile file for other needs.

Keeping "church and state" separate is just a good idea that will save trouble down the road, methinks.

Hope this helps some.
 
1 members found this post helpful.
Old 01-13-2013, 10:56 AM   #13
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Quote:
Originally Posted by ffffdisk View Post
I have to use custom versions of Python, Postgresql and Apache httpd. I have uninstalled them and I will compile them from source, it is a local machine and I am the only user.
I am wondering if due to the importance of the applications I should install them in /usr using /usr/lib64 and /var for the library and state folder.
I'd say that that's never a best practice.

Just build custom Slackware packages and use upgradepkg to swap to them. SlackBuilds for Python and Apache in /source. Change the names of the packages from "*-1.txz" to *-1[YOUR_INITIALS].txz" so that they're recognized as custom builds. SlackBuilds for Postgres and for Python 3 are on SBo.

Last edited by dugan; 01-13-2013 at 12:01 PM.
 
1 members found this post helpful.
Old 01-14-2013, 04:07 AM   #14
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by sahko View Post
No circumstance justifies compiling from source.
I compile from source all the time and I don't see what justification I would need ... because I feel like it.
 
Old 01-14-2013, 09:18 AM   #15
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Quote:
Originally Posted by H_TeXMeX_H View Post
I compile from source all the time and I don't see what justification I would need ... because I feel like it.
I'm pretty sure Sahko meant that no circumstance justifies doing a "make install" into /usr (or /usr/local or /opt).
 
  


Reply



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
[SOLVED] Matlab 7.5 compiled runtime for 64-bit Linux installation: "No JRE" error? zeratul111 Linux - Newbie 4 10-25-2019 12:46 PM
script using "/usr/bin/cat error" produces "cannot open" in cron Dcrusoe Programming 6 07-22-2009 03:30 PM
RPM installation gives "error: cannot create %sourcedir /usr/src/redhat/SOURCES" praveen_darshanam Linux - Newbie 5 01-24-2009 05:59 AM
Can't locate object method "splitpath" via package "PACK001" at /usr/lib/perl5/5.8.8/ sajigeorge Linux - Software 1 01-11-2009 06:33 AM
Compromised? Files "/usr/lib.hwm", "/usr/lib.pwd", "/usr/lib.pwi" Klaus Pforte Linux - Security 4 09-28-2004 11:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:14 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration