Installing Programs




RPM files

Of course the easiest way to install an .rpm file would be to just click on it and open it with kpackage or rpmdrake. However sometimes you may need to install packages from the command line, like when upgrading KDE for example, or you may have recently installed a package and found that you could no longer boot into X, so knowing how to remove a package from the command line could be an advantage.

Here's a quick reference of some command line options:

rpm -qa | grep programname
(lists all packages with programname)

rpm -e *packagename.rpm
(removes a package)

rpm -ivh *packagename.rpm 
(installs a package)

rpm -Uvh *packagename.rpm
(upgrades an existing program with a newer package)

rpm -Uvh --force --nodeps *packagename.rpm
(this upgrades a package, replaces files and ignores dependencies. Be very careful with this command, you could shag your system baby)

For more options, open a console and type:

rpm --help


Src.rpm files

Some packages come as source, distributed as an rpm. These are termed packagename.src.rpm and usually contain a tarball. Open a console as root and type:

rpm --rebuild packagename.src.rpm

When it's done you should see a line somewhere near the bottom saying:

Wrote: /usr/src/RPM/RPMS/i586....nameofrpmfile.rpm

This means it worked and wrote the compiled RPM to that location. You can install it from there or do whatever you want with it.


Compiling Source Code

In order to install from source code you will need to have the "Development Packages" installed, if you don't have these installed you can boot with the Mandrake installation Cdrom and choose "Expert" - "Update", the select to install the development packages.

Always consult the install file, however the typical steps to compile and install source code are:

# ./configure

Why do you type "dot slash configure"? Because the configure script is in the current directory. By default, Linux does not search the current directory for executables; you must explicitly tell it where to look (I spent many hours pulling my hair out and saying nasty things to my computer while trying to install Netscape, the instructions said type: ns-install when I should have been typing: ./ns-install).

# make

This invokes the GNU Make utility to read the Makefile and compile the program for you. Unlike the Linux shell, Make does look in the current directory for its Makefile, so you needn't specify anything else.

# make install

This invokes the Make utility again, this time using it to copy the newly compiled files where need to be in order to run your program.

./configure Errors

If you get "can't find Qt...." error, make sure that you have the Qt devel package installed.

If you get "Can't find X includes" error, install the XFree86-devel package.

If you get "Can't find libz.h", install the zlib and zlib-devel packages.


.tar, .tgz & .bz2 zipped files
 

Source code usually comes in compressed or zipped archives (.tar, .tgz & .bz2). Below are instructions on how to unzip these files from the command line:

.tar files

Open a console and type:

tar xvf *.tar


.tgz files

Type in a console:

tar xzvf filename.tgz

.bz2 files

Type in a console:

bzip2 -d <file name>

Once you've unzipped the file, navigate to the directory that it was unzipped to and read the "install" and "readme" filez for more info on installing the program (see above section "Compiling Source Code").