Installation of Softwares On Linux
When I started my work in Linux I was required to install a lot of packages and Linux itself in to one brand new intel box.This gave pretty good introduction to me about what goes on behinde the scenes. I would like to share them with you.
Compiled binary or pre-compiled binary files are the easiest to install.Copy the files to where ever you want and run its INSTALL script which will guide you.I think this topic doesn't need an explanation. People new to Linux or MS Windows fans will have some difficulty in imagining about softwares distributed as source codes for you to configure, compile and install in your machine. It is that format! RPM stands for RedHat Package Manager, a packaging standard developed by RedHat to ease and standardize installing softwares under Linux. Deb is a similar standard developed and used in Debian Linux distributions. Source Packages Source packages are available for download in almost all free software sites. The famous source installables include Apache, PHP, MySQL etc. First download the package you need from corresponding websites. These distribution usually comes in tar.gz(gzipped tape archive) format which contains all the source files along with the configuration script as well as the Makefiles. Though it may differ, lets consider a generic installation. Copy the tar.gz file to teh directory you like. /usr/local/newdir or /home/mydir/newdir .. Extract the archive using the tar command \$tar -zxvf src_package_name.tar.gz If had you downloaded a .bz2 package you have to uncompress it and un-tar with the following commands. \$bunzip2 src_package_name.tar.bz2 \$tar -xvf src_package_name.tar Options used in tar command z - Filters the archive through gzip, from within GNU tar x - Extract files from archive v - Verbose: to display messages f - Specifies that target is a file rather than a device Take a look at the contents in the directory now by "ls". I strongly recommend you to read the README, INSTALL and CHANGES file you will find. Now, configure the software. Enter into newly created source directory and type \$./configure \$make #make install These steps will have the software configured, compiled and installed into your system. Note the change of prompt in the last command. It means that you got to run the command as root. The ./configure is a very powerful utility the will resolve the dependencies of the software in your system. Ususally, all customization has to be done at this step-like changing the installation path, enabling use of some other softwares etc. You can list the allowed directives by running the following command. \$./configure --help Make is for compiling the software - this may take a few minutes to finish. Make install installs the compiled binaries and it requires root preivileges as normal users wont have write permissions on certain directories. Configuring with options: \$./configure --prefix=/usr/local/apache Configuring for Apache, Version 1.3.19 +using installation pathlayout ......... ...[a lot of useful messages]..... --prefix requests to install all files in /usr/local/apache folder.It will automatically create a folder apache if it is not existing. Configuring with different options may seem to be tricky. Please follow the link given at bottom for an example. RPM and deb Packages RPM Packages are very easy to install.Download or copy the RPM you need from the source.The one and only one step to perform is. #rpm -ivh your_package_name.ix86.rpm Here, the your_package_name is something like netscape_communicator-4.0.1.The ix86 says that it was made for the x86 family of processors-dont worry about it. Options used in rpm i - Instructs to install the package v - verbose - instructs to show status and error messages if any h - hash - shows a progress bar mad of # Querying the System about installed software If you want to see what was the outcome or where the installation was carried out, try the following #rpm -ql your_package_name q - query l - list packages installed and the full path to them. This will have a history printed in your console. Removing a software installed using RPM The command is #rpm -e your_package_name This will remove the software. But it wont allow you to remove the software until certain softwares are depending on it. So you need to remove them first. Upgrading the Software RPM packages are available for upgrades also. Make sure that you are in the directory where the upgrade package is located and run the following command #rpm -Uvh your_package_name U instructs to Upgrame your_package already installed in your system. A lot of options are available for rpm command explore them yourselves. Deb packages are similar to RPMs, but format is different thats all. To install, use- \$dpkg -i your_package_name.ix86.rpm i - yes, your guess is right, stands for install To remove, use- \$dpkg -r your_package_name To Query the installed software use - \$dpkg -s your_package_name Listing contents of the package is done by: \$dpkg -L your_package_name To wind up I want to give you a link that describes about the installation of the source distribution of PHP on Apache. This will be a good example of installing source packages. |