LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2008, 12:08 AM   #1
MJBoa
LQ Newbie
 
Registered: May 2008
Posts: 15

Rep: Reputation: 0
Questions about the linux filesystem and where to install programs..


I was reading about the File Hierarchy System and it utterly confused me. It seems to me, running Ubuntu, that most of what's installed shouldn't be installed where it is. Looks like firefox is installed in /usr/lib/firefox for example, is this where it should be? Should anything I install by myself outside of Synaptic be in /usr/local?

The reason I ask is that I'm inclined to partition my drive so that if I need to reinstall or switch distros/version I don't want to lose anything I've done. Looks like every program I install from Synaptic will be in /usr and not /usr/local but anything I install separately will be in /usr/local so should these along with /home be separately partitioned? Also /var seems to be where MySQL stores the database files and I certainly don't want to lose those if I change distros or reinstall so should that be partitioned separately?

If anyone has any insight or just could tell me how all of their stuff is set up, that'd be great. Thanks.
 
Old 05-29-2008, 12:47 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
Quote:
Originally Posted by MJBoa View Post
I was reading about the File Hierarchy System and it utterly confused me. It seems to me, running Ubuntu, that most of what's installed shouldn't be installed where it is. Looks like firefox is installed in /usr/lib/firefox for example, is this where it should be? Should anything I install by myself outside of Synaptic be in /usr/local?

The reason I ask is that I'm inclined to partition my drive so that if I need to reinstall or switch distros/version I don't want to lose anything I've done. Looks like every program I install from Synaptic will be in /usr and not /usr/local but anything I install separately will be in /usr/local so should these along with /home be separately partitioned? Also /var seems to be where MySQL stores the database files and I certainly don't want to lose those if I change distros or reinstall so should that be partitioned separately?

If anyone has any insight or just could tell me how all of their stuff is set up, that'd be great. Thanks.
Yes, /usr/local is there as a place for one to install system-wide programs which aren't officially part of the distro, although it's quite common for people to ignore that. Personally, I create a /programs directory, and install my stuff in there.

Having stuff on a separate partition can be very practical if you ever need to switch distros or something, but it's not necessary if you make sure to backup your stuff before doing so. By stuff I mean documents, configuration files, databases, etc.

Both my laptop and desktop currently consist of a single partition for / and one for swap. Whenever I install a new distro version I just backup my stuff to removable media or network share and nuke the hard disk.

BTW, even if you have your /var on a separate partition, you're gonna want to do a backup before installing another distro, so having /var pre-populated during the install doesn't really accomplish much aside from saving you a few minutes.

All of this I wrote is just meant as feedback, I'm not suggesting you do things the way I do them or anything like that.

Last edited by win32sux; 05-29-2008 at 12:53 AM.
 
Old 05-29-2008, 12:52 AM   #3
MJBoa
LQ Newbie
 
Registered: May 2008
Posts: 15

Original Poster
Rep: Reputation: 0
OK so where would one install compiled software then if not in /usr/local? I've heard of using /opt but I assume that's not what you meant.
 
Old 05-29-2008, 12:53 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Another popular option (sic) for hand installed stuff is /opt ....
 
Old 05-29-2008, 12:56 AM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
Quote:
Originally Posted by MJBoa View Post
OK so where would one install compiled software then if not in /usr/local? I've heard of using /opt but I assume that's not what you meant.
You can install it wherever you want. Lots of people simply install them into / by ways of "make install". IMHO that's kinda messy, though. A better approach would be to learn how to make packages for your distro, then whenever you compile something you make a package of it and install the package. That gives you the ability to upgrade/remove all of the files you installed, using the distro's package manager.
 
Old 05-29-2008, 12:18 PM   #6
seraphim172
Member
 
Registered: May 2008
Posts: 101

Rep: Reputation: 15
Distributions have their own logic when it comes to file locations. The large distros usually have their own package systems (or use a common package manager) so it's safe to use the package manager (yum, synaptic, ect) to install and upgrade applications that are supported by the distribution.

For any other application that you build or install yourself you should probably use /usr/local for the plain reason that it's usually in each user's PATH. Any other location (/opt, /home/~ or whatever) can be used as well, but you have to add the location to your PATH or always type full pathnames to launch the application.

Linux Archive

Last edited by seraphim172; 06-25-2008 at 05:40 AM.
 
Old 05-29-2008, 02:13 PM   #7
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
Quote:
Originally Posted by seraphim172 View Post
Any other location (/opt, /home/~ or whatever) can be used as well, but you have to add the location to your PATH or always type full pathnames to launch the application.
What I do when I install system-wide programs in /programs (each program in it's own subdirectory - not all clumped together as one would have in /usr/local) is create any necessary links in /usr/local. That way I don't need to edit $PATH. Anything which doesn't need to be system-wide I install in my home folder and add aliases to ~/.bash_aliases. This is on Ubuntu, as I am not good at making Debian packages. On Slackware, though, I find package creation very simple so I pretty much just make a package for anything system-wide.
 
  


Reply


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
Raid0 filesystem questions cgreco Linux - Hardware 4 10-18-2005 09:10 AM
DISCUSSION: Virtual Filesystem: Building a Linux Filesystem from an Ordinary File mchirico LinuxAnswers Discussion 0 10-28-2004 11:35 PM
filesystem usage questions Menestrel Linux - Newbie 3 05-26-2004 12:35 PM
Filesystem questions natalinasmpf Linux - General 2 02-23-2004 08:21 PM
Filesystem questions twinkers Mandriva 2 09-13-2003 08:36 PM


All times are GMT -5. The time now is 04:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration