Questions about directories and installing programs

TBSN

Senior member
Nov 12, 2006
925
0
76
I am pretty new to Ubuntu, but so far I love it. I've set up the power management better and I have most of the programs I need.

I just downloaded a program called celtx (which is a great free screenwriting program, if you're interested).

It came in a .tar.gz folder, which had the program files inside. I could just put it on my desktop and run it. I'm still trying to get used to the cryptic folder names in linux, and the lack of a "Program Files" directory.

What I did was this: I moved the entire folder into /usr/lib, then I made a symbolic soft link in /usr/bin to the shell script file called celtx. There is also an executable file called celtx-bin in the celtx folder, but when I double click on it nothing happens...

So, the shell scrip "celtx" will start the program, and it all works this way, but I was wondering, do shell scripts usually start programs, as opposed to executables?

Did I put the files in the right folders? (or I guess directories, I'm not sure if the word "folders" is used in Linux)

I am still used to .exe files, so this is one thing about linux that I'm very confused about. I don't know what the different directories are for.
/usr/bin?
/bin?
/usr/lib or usr/lib64, usr/local/etc? I'm totally confused.

Thanks for any clarification
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
was there no readme file included with what you downloaded? that ought to tell you what to do and how, and what goes where.

if everything works out of the one folder without you installing any dependencies, you can really put it anywhere and create a shortcut to the celtx script. i think software outside of repos is usually supposed to go in /opt

linux command line intro

explains the file system layout and this and that and the other. enjoy.

 

Fallen Kell

Diamond Member
Oct 9, 1999
6,185
520
126
As xSauronx pointed out, usually "/opt" is the preferred place. Others might also work better under "/usr/local". Personally, I put any installed software under a "/export" which is shared out and automounted. I create a /etc/auto.sw file which is the automount map for a "/sw" mount and modify the auto.master file to read in the auto.sw file for the /sw mount point. This makes it easy to share out stand-alone applications (or ones with few non-standard dependencies) across multiple systems of the same architecture and not need to install them everywhere, I just copy over the auto.sw map file from the main system to the other box (in my case a dual boot laptop).

As for the do shell scripts usually start programs, I would say "yes, in many cases". Things like environment variables are setup in the shell script which then properly calls the executable with all correct arguments and options. It takes a little more of the human error part out of the program, especially for ones which have lots of possible tunable features and parameters.

As for the different directories and what they are for, here is a quick overview:

/etc (system config files)
/lib (library files, usually system related)
/bin (binary files, usually system related)
/usr (user space programs (meaning things run by a user), "lib" meaning library files, "bin" meaning binary files, "man" meaning manual files...)
/usr/local (even more user space files, with "local" meaning that these are usually meant for that specific machine, and not ones that are shared across many machines on a network, although sometimes it is a common shared network location)
/opt (optional software)

The "xxx64" simply means 64 bit version of the library or binary.

There were many conventions for how things were named the way they are, and many of those were created long ago from how the Unix OS's set themselves up. You need to remember that many of these were developed from the standpoint of dealing with large groups of systems all running a OS, and in many cases, systems which may not even have room on their local hard drive to have everything installed on the system locally, and instead, mounted the area over the network from either a data server, or even a boot server (in which the system might not even have a hard drive located in the machine). Because the designers of the OS had those cases in mind, they split up things into groups based on what was required for the system to boot, and what bare minimum library files and applications it needed to have in order to connect to a network and "mount" a remote data area to the local system.

 

TBSN

Senior member
Nov 12, 2006
925
0
76
OK, thanks for the help. I see that Google Picasa is installed in /opt. When I was installing it before I searched for where OpenOffice installed itself and I found it spread out throughout several directories, perhaps because it's a more complicated program. And I'm still not sure what the libraries are for, preferences?

I will move the whole folder to /opt, but should I make a link to the shell script in /bin, or just keep it in the /opt folder? I'll put the link in the /bin folder if that's where it should go.
I put a link to the shell script in the /usr/bin folder before because it would allow me to start the program from the terminal, but are there any advantages to that, other than being able to start the program from the terminal?
I notice that the Picasa folder in /opt has its own /lib and /bin folders, so I guess it doesn't matter where the executable files are?

As I am slowly learning how linux works, it looks like it makes a lot more sense than microsoft, even though most of what linux is based on are the antiquated systems that you referred to. I just hated it how the preference files on XP would just put themselves basically wherever. On my XP machine the documents and settings folder has become a f'ing jungle.

That having been said, maybe keeping all of the files in one directory would make uninstalling something that is not in the repositories easier as the files are not spread over the whole directory tree. But if I make a link to the file, and I delete the file, there must be a utility or something that removes dead links.
 

TBSN

Senior member
Nov 12, 2006
925
0
76
so is it necessary to put a link to the executable in one of the bin directories?
 

TBSN

Senior member
Nov 12, 2006
925
0
76
I see. But if I had no concern with opening the app via the terminal, does it have to be in the path??
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Nope you can always type out the full path to the executable file when you create your shortcuts to it, it's just easier to include /opt in your path if you are going to be installing lots of other 3rd party software.
 

TBSN

Senior member
Nov 12, 2006
925
0
76
Ok, how do I check what's in my path? And how do I change that?