Re: [SLUG] Need help with .bin files!

From: Brad Smith (brad_stephenssmith@yahoo.com)
Date: Tue May 27 2003 - 19:46:16 EDT


> A couple of questions...
>
> 1. Where would one normally install programs on a linux box? For instance, in
> windows (no comments from the peanut gallery please), most installs default to
> somewhere under c:\program files. Where do we put linux installs and why?? Are
> there common standards for where we install stuff to?

One thing that often confuses new users is the way the structure of the *nic filesystem. Get rid
of the idea that a program gets installed to some particular place. It doesn't apply in *nix
nearly as much as it does in Windows. Instead, an application will be made up of libraries
(installed in a lib directory) and binaries (installed in a bin directory) documentation
(generally in /usr/doc or /usr/share/doc), config files (installed in /etc and/or your home
directory) and so forth. Thus, the importance of package management systems like rpm and deb if
you ever want to remove something or see all of the files ascociated with a program.

If you're on an rpm-based system, you can illustrate this with the following commands:

'rpm -qf whatever' tells you which package (rpm) the file whatever belongs to
'rpm -ql whatever' shows you all of the files in package whatever and where they were installed
For a list of packages on the system, rpm -qa

...but I digress. =:)

Another thing that gets newbies when they start poking around is the fact that there's not even
one 'bin' or 'lib' directory. There's /bin, /usr/bin and /usr/local/bin. Ditto for lib. There's
actually a very good reason for this. Each one is meant for a specific type of bin or lib. I'll
use bin as the example but it applies to lib (and others) as well.

/bin - system binaries. The binaries (executables) that make up the core OS. 'ls' is here, for
example.

/usr/bin - This is where non-core binaries that are a part of your distribution go. Example:
'less' is usually here.

/usr/local/bin - Do an 'ls' on /usr/local. You will find that it has most of the same directories
as '/'. /usr/local is (theoretically) for all the stuff that you yourself install. The stuff that
is not a part of your distribution. When you install a third-party rpm it *should* go in
/usr/local/bin, /usr/local/lib and even /usr/local/etc though in reality not everything does and
almost nothing (in my experience) gets put in /usr/local/etc. The idea is that if everything you
install that is not a part of your distriution is in one place, it will be easier change versions
(or even another distro) manually if you don't trust automated upgrades. Just back up /home,
/usr/local/* and elements of /etc, do a fresh install of the new version/distro, restore and
(barring library dependancy issues) you don't have to reinstall any of the extra stuff you've
added.

However, all this works better in theory than practice, in my experience.

Just one more related note: You may have a /opt directory. Traditionally that is where those
applications that do install into one big directory go. For example, on my machine I have
/opt/OpenOffice and /opt/phoeni.. err, firebird.
 
> 2. What do I do with .bin files? Do I just type the filename at the command
> line? I've tried that, but nothing happens. I've also tried chmod and when I
> do an ls it changes color and puts an asterisk after the filename, then I tried
> the filename by itself and nothing. What does the asterisk mean?
>

sh whatever.bin generally works. All a bin file really is is a shell script an rpm or some other
type of package embedded in it. In the case of anything from sun, it's a shell script that makes
you agree to their lisence before getting access to the archive. Typing 'sh whatever.bin' tells sh
(bash) to exec the instructions contained therein. If you're curious, open it up in a text editor
and you'll see what I mean.
 
> I've been logged in as root and as a normal user. I've tried it in my home
> directory and copied to several other directories, to no avail.
>
> Help! Thanks for the advice.
>
> Eric

Hope this helps! =:)

--Brad

P.S. doing 'chmod u+x whatever.bin' (which just gives you exec access, not everyone-- a good habit
to get into) and then running it should work. But remember, if you're not in one of the
directories listed by the PATH environment variable, you have to do ./whatever.bin to specify the
currect directory.

P.P.S. Don't add the current directory (.) to your PATH. It is bad security mojo.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:21:47 EDT