Install Software from Source

Well, installing software on Linux is a broad subject because each version of Linux has its own package management system. However all types of Linux allow the user to install software using the source code. However you probably don't want to tackle this process unless you know a little bit about how to use Linux commands and a little about the Linux file system. If you don't know about these two then its better to read up on them first and then return here.

Uncompress

Installing from source works on any Linux system, so its a good process to know, and it more or less follows this route once you have a source package:

[d:b] ~ # tar xvfz packagename.tar.gz [Enter]
Where 'packagename' in the example above is the actual name of your package that you wish to install. The tar command followed by the parameters xvfz uncompresses a tar.gz file and creates a new directory with all the extracted sources. Now you must change your working directory to this new directory using the 'cd' command. Usually the new directory name is the name of the compressed source package minus the '.tar.gz' suffix. For example, if my package really was called 'packagename.tar.gz' then after running the 'tar zxvf' command on it I would be left with a new directory called 'packagename' and then I would type 'cd packagename' to enter this new directory. If you are not sure of the name of the newly created package type 'ls'.

Configure

Alright... once inside the new directory, we want to start the actual installation process. To do this 99% of the time you will need to type the following:

[d:b] ~ # ./configure [Enter]
Ok, so this isn't really a command. Each installation package usually has a script called configure. By putting a dot and then a slash before the name of the script ( ./configure ) you are telling Linux to execute (run) that script. The configure script then does its stuff, checking what kind of machine you have, what you already have installed, what kind of Linux you are running etc etc etc.

The most common problem that will occur at this stage is that the configure script will halt and tell you that software library that the new software depends on is missing. This can be a pain which is why people invented package management systems. However if you do experience this error then you need to use a search engine to find out what software the error message is talking about and where to get it, then start the installation process again with this new package. I am not kidding when I say that this can sometimes mean an installation can take days while you search and download all the packages you need.

Compile

So, lets assume you don't get any errors created by running the configure script... in which case you are lucky and you should thank whatever angel is looking over you...Now... the next command to type in the install process is make like so:

[d:b] ~ # make [Enter]
This command actually makes (compiles) the software for you. You will then end up with a whole lot of compiled files which in total makes up your software. The 'make' process can take a while depending on the speed of your machine and the size of the package sources you are installing. Running other applications will also slow down the process.

When *make* has stopped, type the following:

[d:b] ~ # make install [Enter]
this will install the newly created software in the correct places in your system. So now you just need to type the name of the application in your terminal window and it should run. If it doesn't run and throws an error, a common remedy is to type *ldconfig* and then try again. ldconfig updates the system so that your operating system knows there are new library files etc.