I N S T A L L A T I O N

Linux

Installing Linux software


Most Linux programs comes as packages: single files which contain an entire compressed application, information about where to install it and other software requirements. Red Hat and Mandrake files have an RPM extension, which stands for Red Hat Package Manager. Packages are a very neat way of keeping track of the applications installed on your machine 

You need to be the root user to install software on Linux. If you use Mandrake you can click the drakconf icon on your desktop, and then click KPackage. Otherwise, open a terminal and type su - and enter the root accountÆs password when prompted. 

Then type either gnorpm or kpackage to launch KDE or GNOMEs package managers. 

If you prefer to use the command lin, type: rpm -Uvh <filename> to install packages, and rpm -e <filename> to uninstall packages.


Source Packages (SRPM files)

Source RPMs contain source code; the raw ingredients to make a piece of software. To æcookÆ your source, you need to compile it. Source packages are relatively easy to install and to integrate with your other packages.

You need to be the root user to install software on Linux. Open a terminal and type su -and enter the root accountÆs password when prompted. 

Then type rpm ûrebuild <filename> to compile the package. The cooked (or binary) package will be created in /usr/src/linux/ix86/ directory.

Then install the binary package using rpm -Uvh </usr/src/linux/ix86/filename> 

Some software requires other software to be installed first. Each RPM file provides a set of services, for example, the Netscape package provides a Web browser service. Other applications require this service to exist before they can be installed. This is called a dependency. You can find the necessary RPMs at www.rpmfind.net.


Installing tarballs (tgz or .tar.gz files)

A tarball is a compressed file similar to WindowsÆ popular ZIP format. Since tarballs don't have dependencies or a central database of what's installed on your system, a package is usually preferable. However, a tarball is often the only way of obtaining new or beta software. 

You need to be the root user to install software on Linux. Open a terminal and type su - and enter the root accountÆs password when prompted.

Make a directory for the software by typing mkdir /usr/local/<program name>

Then type either gnozip or ark to launch KDE or GNOMEs compression programs. If you prefer to use the command line, type tar -xzvf <archive name>  

to extract tarballs to the current folder, or 

tar -czvf <new archive name> <folder to be compressed> to compress file

Programs extracted from tarballs should be placed in a directory called /usr/local/<program name>. 


Installing source tarballs (tgz or .tar.gz files) 

A tarball is a compressed file similar to WindowsÆ popular zip format. The content of this tarball is source code; the raw ingredients to make a piece of software. To `cook' your source code, you need to compile it. Compiling source applications isn't for the faint-hearted, and a package is usually preferable. However, source is often the only way of obtaining especially new or beta software. 

First you need to extract the source from the tarball, then you need to compile and install it. 


Extracting .tar.bz2 files

The .tar.bz2 is another form of Linux compression, similar to .tar.gz format, but capable of far better compression.

To extract files from .tar.bz2 archives, type: tar -Ixvf <archive name> . This will extract the contents of the archive into the current folder.

To compress with .tar.bz2, type: tar -cIvf <net archive name> <folder to be compressed> .


Extracting the source from the tarball

You need to be the root user to install software on Linux. Open a terminal and type su - then enter the root accountÆs password when prompted.

 Uninstall any existing versions of the program with your package manager program. 

Then type either gnozip or ark to launch KDE or GNOMEs compression programs. 

If you prefer to use the command line type:

tar -xzvf <archive name> <destination folder> 

to extract tarballs, and tar -czvf <new archive name> <folder to be compressed> to compress files

Extract the files to /usr/src/<programname>


Compiling source

 Most source applications can be compiled with the following set of instructions, but you should read the programÆs README file for specific instructions. 

Change to the directory where you extracted the tarball by typing

cd /usr/src/<program name

Run the configure script to tailor to compile options to  your system by typing ./configure

Compile the program by typing make, then install the program, by typing make install.

To uninstall the application, change to the /usr/src/<program name> directory and type make uninstall.


Installing from customised installers

Some applications (such as StarOffice, and a few of the Loki games) have Windows-style runnable installers. Packaged versions of these applications are always preferable, but not all manufacturers make their applications available in this manner. Customised installers usually consist of a single, large file (a self extracting archive). 

Open a terminal and type su - and enter the root accountÆs password when prompted.

Make sure the file has the execute permissions, by using chmod a+x <filename>

Run the application. If you're asked about possible install locations, select /usr/local/<program name> as the destination. 


Compiling a New Linux Kernel

Linux kernels are usually distributed in .tar.??? variants. Follow the below steps to extract, compile and install a new kernel:

NOTE: You must be logged in as root to compile a kernel.

1. From the command line, change to the directory /usr/src (cd/usr/src).

2. Create a new directory named: linux-?.?.? (?.?.? being the kernel version); then change to that directory (eg cd linux-4.0.2).

3. Extract the kernel files from your compressed archive. If the file, for example, is named kernel-4.0.2.tar.bz2, use this command: tar -Ixvf kernel-4.0.2.tar.bz2 .

4. Once the files have been extracted, you will probably need to change to a new directory that has been created, usually named linux. Now you need to configure the kernel. To configure using a nongraphical terminal type: make menuconfig . If you are in XWindows, type: make xconfig (from the source directory).

5. After configuring the kernel, you need to prepare for compiling. Type make clean , then make dep . To compile, type make bzImage . When that is finished, you need to type make modules and then make modules_install .

6. Now your new kernel is compiled and the extension modules are installed. Next, copy the new kernel to the /boot directory: cp arch/i386/boot/bzImage /boot .

7. Last, you need to edit the /etc/lilo.conf file. Using your favourite editor (eg. kedit) as the root user, add the following lines to the end of the files:

image=/boot/bzImage

label=new-kernel

root=<look at other entries to get your root partition>

read-only

Save the file.

8. Run lilo as root from the command line and then reboot.