LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-12-2010, 03:36 AM   #1
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Rep: Reputation: 55
RPM installation


Dear All,

when We try to install a rpm, what is the process that exactly happens ?

Till today I was under the perception that rpm -ivh package.rpm will just unzip the package.rpm to place the files in it to corresponding directories, depending on the type of the files.

Does rpm -ivh will compile and install a package ?

Since rpm -qR package.rpm will give the dependency of libraries by the package.

As per my understanding libraries are needed only during the compilation process.

If my understanding is true on rpm installation, How does an rpm depends on some libraries before installation.

Thanks in advance..
 
Old 03-12-2010, 04:00 AM   #2
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Rep: Reputation: 92
The process of RPM package installation

Performing dependency checks:
Some packages will not operate properly unless some other package is installed, too. RPM makes sure that the package being installed will have its dependency requirements met. It will also insure that the package's installation will not cause dependency problems for other already-installed packages.
Checking for conflicts:
RPM performs a number of checks during this phase. These checks look for things like attempts to install an already installed package, attempts to install an older package over a newer version, or the possibility that a file may be overwritten.
Performing any tasks required before the install:
There are cases where one or more commands must be given prior to the actual installation of a package. RPM performs these commands exactly as directed by the package builder, thus eliminating a common source of problems during installations.
Deciding what to do with config files:
One of the features that really sets RPM apart from other package managers, is the way it handles configuration files. Since these files are normally changed to customize the behavior of installed software, simply overwriting a config file would tend to make people angry — all their customizations would be gone! Instead, RPM analyzes the situation and attempts to do "the right thing" with config files, even if they weren't originally installed by RPM!
Unpacking files from the package and putting them in the proper place:
This is the step most people think of when they think about installing software. Each package file contains a list of files that are to be installed, as well as their destination on your system. In addition, many other file attributes, such as permissions and ownerships, are set correctly by RPM.
Performing any tasks required after the install:
Very often a new package requires that one or more commands be executed after the new files are in place. An example of this would be running ldconfig to make new shared libraries accessible.
Keeping track of what it did:
Every time RPM installs a package on your system, it keeps track of the files it installed, in its database. The database contains a wealth of information necessary for RPM to do its job. For example, RPM uses the database when it checks for possible conflicts during an install.
 
Old 03-12-2010, 05:41 AM   #3
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Original Poster
Rep: Reputation: 55
Thanks raju,

Quote:
Performing dependency checks:
Some packages will not operate properly unless some other package is installed, too. RPM makes sure that the package being installed will have its dependency requirements met. It will also insure that the package's installation will not cause dependency problems for other already-installed packages.
My question is why this step is needed ?

Since most of the dependencies are shared libraries, as these are required during compilation of any package to build an executable especially during installation by source code.

rpm's are compiled packages. Still why they need shared libraries during installation ?

Can anybody clarify this ?

Thanks again.
 
Old 03-12-2010, 08:20 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Quote:
Originally Posted by vinaytp View Post
rpm's are compiled packages. Still why they need shared libraries during installation ?

Can anybody clarify this?
Let's try. RPMs need other RPMs to work properly (not simply to be installed, unless your system lacks the /bin/rpm executable itself... and some other things). Since they are shared libraries, it means that they are not built (included) in the binary executables, but only referenced (otherwise they would be static libraries). The advantage is to keep programs light, to avoid redundancy (not useful repetition of the same blocks of code inside different programs) and usually to speed-up their execution.

Edit: a good and brief explanation of the difference between static and shared libraries is given here and here is the relevant quote:
Quote:
An executable file linked against a shared library contains only a small table of the functions it requires, instead of the complete machine code from the object files for the external functions. Before the executable file starts running, the machine code for the external functions is copied into memory from the shared library file on disk by the operating system--a process referred to as dynamic linking.

Dynamic linking makes executable files smaller and saves disk space, because one copy of a library can be shared between multiple programs. Most operating systems also provide a virtual memory mechanism which allows one copy of a shared library in physical memory to be used by all running programs, saving memory as well as disk space.

Furthermore, shared libraries make it possible to update a library without recompiling the programs which use it (provided the interface to the library does not change).

Last edited by colucix; 03-12-2010 at 08:30 AM.
 
Old 03-12-2010, 08:47 AM   #5
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Rep: Reputation: 92
Quote:
Originally Posted by vinaytp View Post
My question is why "dependency check" step is needed ?

Since most of the dependencies are shared libraries, as these are required during compilation of any package to build an executable especially during installation by source code.
Hi vinay,

Take an example

We need to install software "A" { which has dependencies x1,x2....}

But We have Shared libraries X1,X2... { which are latest or older versions of x1,x2.. But not same version we need.}

Then dependency checker will identify this. It says that software "A" needs x1,x2...

Simple words, I Want to say, some softwares needs exact versions of libraries. some softwares need exact version or greater version. so this information must be verified by Dependency checker.
 
Old 03-12-2010, 09:33 AM   #6
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by colucix View Post
Let's try. RPMs need other RPMs to work properly (not simply to be installed, unless your system lacks the /bin/rpm executable itself... and some other things). Since they are shared libraries, it means that they are not built (included) in the binary executables, but only referenced (otherwise they would be static libraries). The advantage is to keep programs light, to avoid redundancy (not useful repetition of the same blocks of code inside different programs) and usually to speed-up their execution.

Edit: a good and brief explanation of the difference between static and shared libraries is given here and here is the relevant quote:
This clarifies.

Thanks Colucix and Raju
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rpm -ihv hp_qla2x00src-8.01.07.25-1.linux.rpm during Qlogic driver installation Dennisliu Linux - Software 5 09-10-2008 06:08 PM
Hosed my rpm installation (i.e. "rpm -e rpm") Mad Scientist Fedora 6 03-02-2007 01:42 AM
RPM installation RedDevils Fedora 8 12-24-2003 10:07 AM
RPM installation sanjiv Linux - Newbie 12 11-25-2003 10:00 AM
RPM installation rheza Slackware 8 04-04-2003 11:45 PM


All times are GMT -5. The time now is 08:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration