Sunday, August 23, 2009

What is rpm?Why rpm?How rpm ?and When rpm ?

What is rpm ?
It is a package file format or a software packaged in that format such as [softwarename.version.release.architechture].rpm. Originally developed by the Red Hat and it is used by most of the Red Hat based platforms like fedora.
Why rpm ?
-rpm repos contains thousands of free softwares [repos are places in web where the packages are stored and made available to public ]
-easy to install [rpm -i filename.rpm]
-easy to transport [easy to copy the single file instead of the scattered source ]
-easy to check integrity [we can easily check the integrity using the md5 ]
-a new version of the rpm file format drpm(Delta rpm) saves a lot of bandwidth while updating the system.
The major disadvantage is that the package cannot perform automatic dependency check.For that we have to use the package managers such as yum.
How rpm ?
Rpm files can be installed in a supporting platform by simply typing 2 commands in the shell.
take a shell
become the super user
$ su
goto the directory containing the rpm file
# rpm -ivh filename.rpm
for fresh installation of a package
# rpm -Uvh filename.rpm
for Updating a package
Done !!!!!
So this is how it looks simple other than compiling the whole code once.
When rpm ?
U may wonder why we need these thing if we have a yum package manager or yumex (gui for yum). Those are only useful when we have an high speed internet connection. Imagine a situation where we need 100 systems to be installed with a same set of packages and we have a damn slow net connection. One thing we can do is that , we can make the connection a high speed one. But imagine a situation where u can install the whole set of packages with in adownload time of one package. Will that make a difference ?
Yea it will
The solution is that download the packages using a yum package manager, which will automatically download the depedencies. What this yum does is that after installation this manager deletes the whole packages downloaded from the repos. So u cannot use it to install the software in another system. Copy the rpm files before it deletes ,thats the solution.
The downloaded rpm files are stored in the folder /var/cache/yum/
there will be two directories, in case of fedora it will be fedora and update
either copy these folders after the downloading of packes by the yum is complete.
Or kill the yum process by Ctrl -C or kill using kill -9 pid of yum ,then copy the files
Next step is that we can use the yum to install the packages or we can use the rpm command to install the files
Installation using the yum in another machine.
Copy the files to the same /var/cache/yum/ directory using the cp -rfu command which will update copy the files
then give the command yum -y install package names given in the system where u have downloaded the packages
Installation using the rpm command in another machine
Copy the files to any directory . Go to that directory in shell then
goto the updates/packages directory
give command
# rpm -Uvh *
then goto the fedora/packages directory
give the command
#rpm -ivh *

Done !!!!!!!!!!!!!
In case it is showing any dependency problem u have to download the corresponding package.
If dependencies are more go with the first method.





No comments: