April 19 2014 14:42:37
Deutsch    English
Forum Threads
Newest Threads
DVDs abspielen
Building Codecs from...
nochmals Cookies
WLAN Probleme
Hottest Threads
No Threads created
Social Bookmarks


Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Users Online
Guests Online: 5

Members Online: 0

Total Members: 62
Newest Member: sTheiling
Understanding Package Management

Understanding package management

    In Linux there are a variety of package managers. Each of them with their own goals, features and benefits. The basic purpose of a package manager is to install or upgrade packages efficiently and cleanly. A package manager should correctly handle dependencies. Preferably, with little to no interaction from the user.

    Dependency resolution is the primary function of a package manager. With out this basic function, you might as well download the packages, and install them in proper order yourself. In fact, Linux didn't always have package managers. So back then, you did have to download and install the packages in the correct order.

    In the summer of 1994 Red Hat released RPP which was the precursor to RPM. Also in the summer of 1994 Ian  Murdock, the founder of Debian began working on dpkg. But while you can download a package to your hard drive, and use RPM or dpkg to install it, if you don't have all the dependencies met, RPM or dpkg will fail, complaining about dependencies. To this end, package managers such as yum, apt, synaptic, YaST, urpmi/rpmDrake, and a host of others have been developed. These were front ends designed to enhance rpm or dpkg or the other system package managers. They provided enhancements such as a graphical interface, and allowing users to add repositories. By adding repositories, this greatly improved the dependency resolution ability since the dependencies could be fetched from the repositories.

    The next thing that played a part in dependency resolution was the algorithm. The algorithm is what allows the package manager to calculate the dependencies. This is another major factor in package managers, as the algorithm is what makes the package manager correctly resolve dependencies. There has been a lot of advancements made in the algorithms for the corresponding package managers.

 Understanding packages

    All programs start as packaged source code. This is even true in Windows. Then it is then packaged into a more user friendly package. In Windows you recognize it by an .exe in which the InstallShield unpacks and installs, and registers the software with the Windows registry. Once you understand this, the concept of packaging in Linux isn't so different.

    In Gentoo, they use e-builds. These e-builds point to source packages that work with a package manager called portage. In Debian, the packages are done as .deb, in which they use dpkg, which is quite similar to rpm. Then we have the rpm distributions (Redhat, Fedora, openSUSE, Mandriva, etc...), which use rpm. All package managers do is take the source, package it in a binary executable. This is how you receive it. Then for you to use it, you use the package manager which extracts it, installs it, and registers it with the system.

    In every package, there are things called dependencies. A dependency is something that a package relies on to make it work. In most cases, it would be another package. Also, in packages, there are obsoletes. This is what is outdated by installing or upgrading to this package.


    So what are these things called repositories? Repositories are either local directories, or web sites that maintains and distributes a collection of software packages. Often, but not always, these repositories contain a file or directory with metadata. By local, we are referring to someplace on the users hard drive.

 What is metadata?

    From the Free On-line Dictionary of Computing:
<data> /me't*-day`t*/, or combinations of /may'-/ or (Commonwealth) /mee'-/; /-dah`t*/ (Or "meta data") Data about data. In data processing, meta-data is definitional data that provides information about or documentation of other data managed within an application or environment.

For example, meta-data would document data about data elementsor attributes, (name, size, data type, etc) and data about recordsor data structures(length, fields, columns, etc) and data about data (where it is located, how it is associated, ownership, etc.). Meta-data may include descriptive information about the context, quality and condition, or characteristics of the data.

    So what does all that mean? Meta-data is data about data. In the case of packages, repositories and package managers, meta-data is what provides information from the repositories to the package managers about the packages on the repositories.

    Meta-data contains the product name, the description of the product, the version of the product, dependencies, and obsoletes. This is then read by the package manager, and the job of the package manager to handle this correctly.

No Comments have been Posted.
Post Comment
Please Login to Post a Comment.
Current Rating: (Total: 0 ratings)  
Current Average Rating: 0 Stars
Share this article
Share |