FlyZhy.Org logo Projects - Installing Software

Why
How
Installing from Scratch
Installing RPM Packets
Installing DEB packets
Installing TGZ packets
Where

Years ago it was more complicate for installing software on GNU/Linux, in the begin we had the source code and we had compile it. But why source code here, how and why compile it? Here exists my muse about the Why and How questions.1

Why

I think there exists at least three reasons to compile software from the source code before installing it.

How

Generally speaking, there are three steps to install software on GNU/Linux which are download, compilation, and installation (maybe add configuration here before you can use it). However, different GNU/Linux distros have different mechanism for package management. First of all, I will talk about the general situation for GNU/Linux users to do the How. And then, I will summary the other situation for different GNU/Linux distros.

Installing from Scratch

Sounds like the famous GNU/Linux distro - LinuxFromScratch (LFS) ^_^. However, it's the best method to install software by compiling from the source code (scratch). Also you can get the latest version of the software. And I got the basic idea to know about the software which I did not know it at all from a layman to a fellow as follows:

download

There are many kinds of usable compress format in GNU/Linux. Actually I met only a few of them frequently.

Notice: Assume the name_program-version is the real name with version of the software you want and the symbol "#" (not include the quotation marks) stands for the shell prompt.

compiling

After download and decompress the software package, we will see the real source code of the software (also assume in name_program-version folder). Generally, there exists the file named "README" or "INSTALL" or the folder named "doc", "docs", or "document". Read these files in detail especially about the section of installation if you did not read the similar section on the homepage of the software. Then do the following steps if you find the file named "configure" in the name_program-version folder.

#cd name_program-version
#./configure
#make
#make check

Notice that #make check is optional here.

Errors? Of course. If your hardware and system aren't compatible to the software you'll look any errors when you do the #./configure and #make. Fortunately the errors will tell you what you need to do or what dependencies your system lost. Follow them and find the answer first by yourself (maybe you need Google or other search engine to help you). If you are crazy about the errors at last, ok, find the software mailing-list or bbs about the category to post your problem, and then go out and forget it until you feel happy enough to check other people's response about your problem.

installing

It's easy to install the software by default path defined by the software author (the defautl path is /usr/local/ mostly, you can change it by #./configure --prefix=/path/to/here when compiling and try #./configure --help for more options)

#make install

Notice that when execute #make install maybe you should switch user to root by the command sudo or su.

configuring and using

If you want to use the software as you wish, you must read the help documents or manual in detail to configure it for your usage. Also the important part of software is to use it. And I think that should be left for yourself. ^_^

Installing RPM Packets

Now we can also install Redhat Packets (.rpm) while RPM stands for Redhat Package Manager. It's very easy to install .rpm packages if you choose the correct package for your computer arch (i386, i586 or i686) and system (Redhat, Fedora Core and SUSE use RPM package as default).

rpm -e package_name
    Removes "package_name" from the system.
rpm -qa
    Queries RPM database lists all packages installed.
rpm -qpl package.rpm
    Queries 'package.rpm', lists all files.
rpm -qpi package.rpm
    Queries 'package.rpm', lists info.
rpm -qf /some/file
    Check which package owns a file.
rpm -Uvh package.rpm
    Upgrade 'package.rpm', be verbose, show hash marks.
rpm -ivh package.rpm
    Install 'package.rpm', be verbose, show hash marks.

Read this page (in Chinese) for more information about installing RPM packets.

Installing DEB packets

It's the same situation as RPM packages except that the Debian GNU/Linux uses DEB package as default.

dpkg -r package-name
    Removes 'package-name' from the system (as listed by dpkg -l).
dpkg -l
    Shows all installed packages.
dpkg -c package.deb
    Lists all files in package.deb (rpm -qpl).
dpkg -I package.deb
    Package's list of http://www.debian.org/.
dpkg -i package.deb
    Install package.deb.
Debian have an method more easy and not complicate to install software register.
apt-get install nameprogram
If the nameprogram is in the debian's server the installation is automatic.

Read this page (in English and Chinese) for APT and Dpkg Quick Reference Sheet.

Installing TGZ packets

It's a little different from the above two situations because all the standard package manage tools are shell scripts and Slackware Linux uses TGZ package as default.

installpkg package.tgz
    Install package.tgz
removepkg package-name
    Removes 'package-name' from the system
explodepkg package.tgz
    Compress package.tgz
upgradepkg package.tgz
    Upgrade package.tgz
makepkg package.tgz
    Make package.tgz
pkgtool
    Software package maintenance tool

Read this page (in Chinese) for more information about the mechanism of package management for Slackware Linux.

top

Where

There are any web with almost packages, here there are any links.


1. It's very important to be familiar with Shell programming for this section, read Advanced Bash-Scripting Guide for reference.