Website based on my experience working as System Administrator

LINUX INFORMATION WEBSITE

This site is dedicated to providing tutorials, help, guides and links for Linux users.
HOME PAGE
LINUX COMMANDS
   
   
   
   
   
   
   
   
   

LINUX COMMANDS

Contents | Previous | Next

Installing software

Generally, there are two ways to install software. One is to download a source tarball (.tar.gz, .tgz, .tar.bz2), compile, and install it; the other is to install an RPM (or the less common equivalent in Debian GNU/Linux, a Debian package).

One of the biggest problems when installing software is dependency problems. Either an RPM refuses to install because it first requires something else be installed, which you are informed off, or often in the case of compiling from a source tarball, a cryptic error message is displayed.

Because RPMs install with a single command, and do dependency checking, displaying a clear indicator of what the problem is, for the beginner they are recommended. RPMs are supported by Red Hat Linux, Mandrake, SuSE, and many more.

Often though, either a website doesn't offer the software as an RPM, or RPMs have yet to be created for the latest version of the software.


Installing software from source tarballs

Usually this involves downloading the software, extracting it, and cd'ing in to the newly extracted directory, for example:

tar xvfz glimmer-1.2.1.tar.gz   (or: tar xvfj glimmer-1.2.1.tar.bz2)
cd glimmer-1.2.1

...then entering the very common, three commands:

./configure
To run the configure script, to create the Makefile file.

make
To compile the source code (to create the binaries), using the Makefile file.

make install
To install the binaries (and some other files) in the directories specified in the Makefile. This command requires you be the root user.


To uninstall the program later on (a feature that isn't always provided for), in the extracted directory, enter:

make uninstall


Prior to entering ./configure you should read the included documentation. Usually text files with filenames indicated in uppercase. Notably README, and INSTALL.


On rare occasions sites can be irritating by archiving the contents of a directory, rather than the directory itself. Extraction then results in all files and subdirectories being extracted to the current directory, and getting horribly mixed up with everything else. To ensure the tarball is extracted to its own directory, enter:

tar tfz glimmer-1.2.1.tar.gz   (or: tar tfj glimmer-1.2.1.tar.bz2)

If the files listed do not all begin with something like glimmer-1.2.1/ then instead of a normal extraction, enter:

mkdir glimmer-1.2.1
tar xvfz glimmer-1.2.1.tar.gz -C glimmer-1.2.1


RPMs and Debian packages

The Red Hat Package Manager, used by Red Hat Linux, Linux-Mandrake, SuSE Linux, and many other Linux distributions, is a utility that allows you to install, query, build, and uninstall RPM files (*.rpm). An RPM is usually named as follows:

packagename-version-release.architecture.rpm

For example:

xchat-1.8.5-0.i386.rpm

...where the package name is xchat, the version is 1.8.5, the release is 0, and the architecture is i386.

Note:

To determine your architecture, enter arch. An Athlon for example is i686 architecture, making it fine to install *.i686.rpm, *.i585.rpm, and *.i386.rpm RPMs.

For convenience the popular Debian GNU/Linux distribution, which uses *.deb files instead of the more prevalent *.rpm format, is also shown alongside the rpm commands.


rpm -Uvh xchat-1.8.5-0.i386.rpm
Upgrades xchat or installs the package if no previous version was found. U for upgrade, v for verbose (so you know what's going on), and h for hash (to show a progress bar).

Debian equivalent: dpkg -i xchat_1.8.5-0_i386.deb


rpm -e xchat
Uninstall (erase) the package xchat. When uninstalling, you only give the package name part, e.g. xchat, not the full package name, e.g. xchat-1.8.5-0.i386.rpm.

Debian equivalent: dpkg --purge xchat   (or dpkg -r xchat to remove but keep configuration files, in case you decide to reinstall later on)


rpm -q xchat
Query RPM database, to display version of X-Chat installed. Useful for discovering if you have something installed.

Debian equivalent: dpkg -l xchat   (l for list)

Tip:

To display all (-a) RPMs installed, in alphabetic order, and in the less program, enter:

rpm -qa | sort | less

Debian equivalent: dpkg -l '*' | sort | less


rpm -qi xchat
Query RPM database and display information about an installed RPM. Notably a description of the software.

Debian equivalent: dpkg -s xchat   (s for status)


rpm -qip xchat-1.8.5-0.i386.rpm
Displays information about the RPM, xchat-1.8.5-0.i386.rpm, located in the current directory. Notably a description of the software.

Debian equivalent: dpkg -I xchat_1.8.5-0_i386.deb


rpm -ql xchat
Query RPM database and display (list) the files installed by this RPM.

Debian equivalent: dpkg -L xchat


rpm -qlp xchat-1.8.5-0.i386.rpm
Displays files that would be installed by the RPM, xchat-1.8.5-0.i386.rpm, located in the current directory.

Debian equivalent: dpkg -c xchat_1.8.5-0_i386.deb


# ldconfig

If a source tarball, RPM or Debian package include the word "lib" in the filename, then it's a library file, used by other programs to perform common tasks.

After installing a library file, you need to make its presence known to ld. You do this by entering, as root:

ldconfig

If you receive a "command not found" message (because you swapped to root with just an su instead of su -), enter the commands full path:

/sbin/ldconfig

This scans the directories indicated in the /etc/ld.so.conf text file, to update the known library files.

Contents | Previous | Next

 
Last Update: Jan 2003

HOME | CONTACT | FAQ'S | TRICKS & TIPS | WEIRD NEWS
This Material has been taken from different sources. Its free for anyone to use and reproduce.