Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-10-2005, 07:47 PM   #1
LQ Newbie
Registered: Nov 2004
Posts: 6

Rep: Reputation: 0
What's In A Package File?

This is a bit of an abstract - and probably blindingly obvious - question, I know; but what's in a package file? The reason I ask is that I had always assumed that a package (e.g. RPMs) contained pre-compiled binary files that a package manager placed in some standard or specified directory. Then I got to thinking: if the files are all pre-compiled, why does the average RPM file have dependencies? Surely it shouldn't have to rely on something already being there if the programs have already been "made up"?

I get the feeling that this is going to get down to some Linux fundamentals at some stage; so links to webpages that give step-by-step dummy instructions would be helpful!
Old 05-10-2005, 08:18 PM   #2
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 76
The reason why RPMS and other Linux packages (yes debs, tgzs, source, etc have dependencies as well) is to make use of shared libraries, files or features provided by other packages. There is no point in bundling files that are provided by other package because they will interefere with each other e.g. overwrite the ones from another package. Creating dependencies on other packages also results in smaller packages because you don't have to bundle all dependencies into one big package and then do the same for other packages.
Old 05-10-2005, 08:20 PM   #3
Senior Member
Registered: May 2003
Location: /var/log/cabin
Distribution: All
Posts: 1,167

Rep: Reputation: 45
Yes, programs rely on other programs. As an example, no programs would be running if they didn't have the kernel to run atop of the hardware layer.
Every try running office on a toaster?

The rpm's aka RedHat Package Management files are simply compressed files with archival data, dependency data, timestamp data, size data, and the like as part of the packaging.

RPM packages are also source code. Example, kdelibs3.src.rpm. That is the source code which can be recompiled into a binary, which would be kdelibs.i586.rpm or the like. rpmbuild --rebuild *.src.rpm would render your spanky fresh *.i586.rpm binary.

No man is an island. And no package stands alone, in any OS. It is inefficient to have static libraries and associated files with every package. The packages would end up being very non-modular and windows-like and bloated. And that's bad.

Package managers like apt, urpmi, apt4rpm, yum, and the like use intellect to solve the issues of dependencies. It's a modular strategy towards making yoru system only take what it needs, rather than force feeding you tons of shit you don't.
Old 05-10-2005, 08:28 PM   #4
Registered: Dec 2003
Location: Calgary, AB
Distribution: Any!
Posts: 146

Rep: Reputation: 18
You have the right idea: a package is just a bunch of precompiled files. They can do some extra work, too. Debian packages (probably redhat.. but I'm not too familiar with RPMs) have the ability to run pre-install scripts and post-install scripts. An example would be to email you that the package is about to be installed and that it is done installing.

The reason a package has dependancies is because the author tries to break the package down into the most maintainable and flexible chunk. This allows you to mix and match with packages.

Lets take openssl for example. You can install the openssl rpm and now have the ability to use openssl (logically). Now lets say you download a tar.gz file that you are going to compile yourself. In order to compile it, it needs the openssl header files. Those are stored in the openssl-devel package. So now you need to install that beforehand. Why split them into two parts? Cleanliness, space, security: if you don't need the devel files, why have them on your system? If an intruder breaks into your system, why give him access to files he doesn't need?

Here's another example on dependancies: Lets say you want to install gaim. Gaim is a GUI application that relies on GTK. You don't have GTK on your computer. When you install gaim, it complains that you don't have GTK. "Screw it, I'll just force it!" So you run

rpm -Uhv --nodeps --force gaim.rpm
And it forcefully installs gaim. So now you have the (precompiled) gaim files on your computer. When you start the program, it gets furious. "Whoa.. where's GTK at?" and dies. So now you definitely need to install GTK to calm Gaim down.

The obvious solution would be to package Gaim and GTK up together since they go hand in hand. But now you've just made your package bigger. And lets say a security fix comes out for Gaim. That means you need to get a new Gaim+GTK bundle. And what about GIMP? He needs GTK too. So are you going to bundle GIMP+GTK? What about Gaim? Now you've got GIMP+GTK and Gaim+GTK. If one author of the package decided to use an older version of GTK than the other.. you can't have both programs on your computer since you're only allowed 1 GTK (well.. there are ways.. but no.. don't do it..).

Hope that helps a bit
Old 05-13-2005, 12:58 PM   #5
LQ Newbie
Registered: Nov 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks very much; I think I understand this a little better now!


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
A question on file-manager package satimis Linux From Scratch 2 09-07-2005 11:22 PM
How to package a .deb file from source? hkl8324 Debian 1 06-09-2005 05:13 PM
Installed file conflicts with file from package XFree86-4.1.0-26 LinuxOff Linux - Software 2 09-06-2004 02:00 AM
Command to find out which package contains which file ? javeree Slackware 6 07-10-2004 06:35 PM
Package to read graphic file - wb satimis *BSD 0 05-07-2004 02:54 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:22 PM.

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