Linux Download Basics

From ITCH

Jump to: navigation, search

Contents

Linux Download Basics

It is best to download your Linux application files through your Linux OS as downloading them through Windows can cause problems by corrupting some file types.

Which File should you Download?

On the whole there aren't single executable files for applications that run in Linux; there are no '.exe' files as in Windows. There is a package manager (Red Hat; Fedora Core; Debian) that enables downloading, checking of dependencies, installation, and intelligent updating of software through the GUI (graphical user interface). However there may still be times when it isn't possible to use an RPM or equivalent and the only documentation talks about entering text commands in order to 'make' and 'install' your files. You may wonder what this means. You can use the command line interface to download and install files, it isn't difficult - you just need to be a bit careful.

Source or Binary?

You can usually get the 'source code' for applications - this the principle of their being 'open source', after all! But working from the source may involve you having to do some work to get the application to run on your system. Many applications are also provided as precompiled 'binaries'; you'll need to look for the best match for your system. In some cases, different binaries are provided for different Linux distributions - in other cases there is a single binary which is designed to work on most distributions. Look in this case for the generic version which may have i386 in its name somewhere. The i386 refers to Intel based systems which means most PCS.

Some applications are available for Windows, Macintosh, Linux and Commercial Unixen. You may also find references to binaries for 'Cygwin' (a Unix emulator for windows) and BSD (another 'free' Unix and the basis of the Mac OS X operating system).

Downloading, Unzipping and Untarring (via the Desktop)

Unix can be a bit picky about where you install things, and it is usual to install applications in a directory called /usr/bin or /usr/local. You should be able to navigate to these via the desktop file explorer.

You may need 'root' permissions to install here, however, and if you don't have this, you may have to install in your home directory (where you should have 'write' permissions, or you wouldn't be able to store any work. This is where you can run into problems, because some programs must be installed as root. This is where you may find that you have to return to the website or to Sourceforge and look for installation instructions, consult FAQ or email either the creators or user group for the application.

Once you have downloaded a file it will probably have a name like:

applicationname.gz or applicationname.tar.gz or applicationname.tgz

This means it is zipped. And it needs to be unzipped. If it has 'tar' or 't' in there it needs to be untarred as well. ('Tarring' is an echo from Unix Prehistory when files were stored in Tape Archives, and files which have been 'tarred' are often known as 'tarballs').

KDE and Gnome should automatically unzip these files for you and a directory icon should appear in the window beside the zipped and/or tarred file.

You've now got all the things you need, but you probably haven't installed anything yet! You probably have a nice new icon of a directory labelled applicationname.

Downloading, Unzipping and Untarring (via the Command Line)

You might think this is unneccessary, but sometimes the above process will fail. In this case, the alternative approach is to go 'under the bonnet' because if you install from the Command Line (see Shell commands and info for details), you get a better picture of what is going on - including diagnostic messages telling you if things are going wrong.

Here's the basic procedure for most applications, and I am assuming that the application is both zipped and tarred:

1. Open a console window and type cd directoryname to change directory to the one you want to be in. Remember that typing cd .. takes you 'up' and directory and if you get really lost typing cd on its own will return you to your starting point. If you know you've put your download in /usr/local/ then you can go straight there by typing cd /usr/local/ (or whatever).

2. Type ls just to reassure yourself that applicationname.tar.gz is there. If not you are (a) lost or (b) didn't download to the place you thought you did.

3. If the file ends in .gz' you will need to unzip it using gunzip by typing: gunzip applicationname.gz

4. Type ls again and you should now see that as well as applicationname.tar.gz you have another file called applicationname.tar. This will be bigger, as it has been decompressed.

5. Untar it by typing tar -xvf applicationname.tar. The 'switches' (x, v and f) make tar (which is really quite a complex program), behave the way you want. The 'x' is essential - it tells the tar program to eXtract - if you don't, it will try and tar an already tarred file and you will have something like applicationname.tar.tar. The 'vf' instructs tar to report Verbosely a File at a time.

On pressing the 'Return' key you will see the results of you 'untarring' scrolling up the screen (this is the 'verbose' bit). This should finish nice and cleanly but if there's a problem you should get a report.

As before, you've now got the 'kit' you need but it still isn't installed. What you will probably have is a new directory called applicationname.

Installation

The installation process should be much the same in either the Desktop Environment or from the Command Line, but as before, if you run into problems or are trying to do anything fancy (like installing to an unusual place) you will probably find the command line more helpful.

In addition, many application developers will assume that you are installing from the Command Line (they don't know what Desktop Environment you are using!) so their instructions will be oriented this way.

1. Open the directory called applicationname

2. Look for a text file called 'INSTALL'. There may also be one called 'README'. Contrary to popular belief, you should read this file.

3. The 'INSTALL' file is your guide from here on in. It will probably tell you to look for another file called either 'CONFIGURE' or 'CONFIG'. If you are using your Desktop Environment, a click on this is sometimes enough to install everything. In other cases, you have to open this file and make changes to it as instructed in the 'INSTALL' file.


Note: While in some cases your untarred directory will contain a well-constructed set of documentation in text or HTML format throughwhich you can browse, in other cases, and particularly in early releases of software, the 'INSTALL' file is the ONLY DOCUMENTATION you get.


4. Some applications use what is called a 'MAKEFILE'. This is used when your application has 'dependencies' on other programs, software libraries, programming languages and so on. Running a utility called make (read the INSTALL file) will check everything needed is in place and then will guide the installation of the application.

Another 'verbose' program, make can also run checks and tests (if the application developer has set these up) to see that everything is running as it should. You're likely to be using the Command Line for this, so at least if you get a message back reporting a problem you can do something about it.

Make usually starts off being very upbeat:

"Checking if your kit is complete... Looks good ...."

It then often writes zillions of lines of text to your screen. If there is an error it will report it fairly obviously and may stop at the point it thinks you're just not going to get this installed.


Note on Open Source Etiquette: It is not done to post the zillions of lines to a newsgroup or mailing list with the words 'Can anyone help?' at the bottom. Cut and paste the line beginning "ERROR:", run it through a search engine and see if anyone else has had the same problem.


Typically, email lists, newsgroups and FAQ's are littered with enquiries about specific installation problems, which (assuming the application is not itself the problem!) generally seem to come down to:

  • Not having the permissions to install things
  • Not having other programs or components in place on which the application depends (and which you may have to install yourself)
  • Distribution-specific problems (including differences between versions)
  • Platform-specific problems
  • Not reading the instructions
  • Not having any instructions

Back to Linux pages

Main Page

Personal tools