The Linux GUI Experience

The Linux GUI Experience

Sections: 1 | 2 | 3 | 4 | 5 | 6 | Index | Next >

Libraries And Packages In Linux

Learning objective: Explain the role of library and package dependencies in Linux

Click on image to enlarge.

A typical desktop Linux distribution comprises a Linux kernel, GNU tools and libraries, additional software, documentation, a window system, window manager, and a desktop environment. Most of the included software is free software/open-source software which is distributed by its maintainers both as compiled binaries and in source code form, allowing users to modify and compile the original source code if they wish. Other software included with some distributions may be proprietary and may not be available in source code form. Many distributions provide an installation system akin to that provided with other modern operating systems. Some distributions like Gentoo Linux, T2, and Linux From Scratch include only binaries of a basic kernel, compilation tools, and an installer; the installer compiles all the requested software for the specific microarchitecture of the user's machine, using these tools and the provided source code. [Wikipedia]


In computer science, a library is a collection of subroutines or classes used to develop software. Libraries contain code and data that provide services to independent programs. This allows the sharing and changing of code and data in a modular fashion. Some executables are both standalone programs and libraries, but most libraries are not executable. [Wikipedia]

Software package

A software package refers to computer software packaged in an archive format to be installed by a package management system or a self-sufficient installer. Linux distributions are normally segmented into packages. Each package contains a specific application or service. Examples of packages include a library for handling the PNG image format, a collection of fonts, or a web browser. The package is typically provided as compiled code, with installation and removal of packages handled by a package management system (PMS) rather than a simple file archiver. Each package intended for such a PMS contains meta-information such as a package description, version, and "dependencies". The package management system can evaluate this meta-information to allow package searches, to perform an automatic upgrade to a newer version, to check that all dependencies of a package are fulfilled and/or to fulfill them automatically. [Wikipedia]

Dependencies and dependency hell

Dependency hell is a colloquial term for the frustration of some software users who have installed software packages which have dependencies on specific versions of other software packages. This was mainly attributable to old Linux package managers. Current package managers have largely solved this problem by automatically resolving and downloading dependencies. Often, rather than "reinventing the wheel", software is designed to take advantage of other software components that are already available, or have already been designed and implemented for use elsewhere. This could be compared to how people building a house might buy off-the-shelf components, such as bricks, windows, and doors, rather than producing everything themselves. Even for a builder, it can be a problem if a building is designed for a certain door type, and only doors with different specifications are available. However, in the software world, where components evolve rapidly and depend significantly on one another, this problem becomes more pronounced. [Wikipedia]

An application depends on many libraries, requiring lengthy downloads, large amounts of disk space, and not being very portable (all libraries must be ported for the application to be ported). It can also be difficult to locate all the dependencies, which can be fixed by having a repository. This is partly inevitable; an application built on a given platform (such as Java) requires that platform to be installed, but further applications do not require it. This is a particular problem if an application uses a small part of a big library (which can be solved by refactoring), or a simple application relies on many libraries. Thus, app depends on liba, which depends on libb, ..., which depends on libz. This is distinct from "many dependencies" if the dependencies must be resolved manually (e.g., on attempting to install app, you are prompted to install liba first. On attempting to install liba, you are then prompted to install libb.). Sometimes, however, during this long chain of dependencies conflicts arise, where two different versions of the same package are required[4] (see conflicting dependencies below). These long chains of dependencies can be solved by having a package manager that resolves all dependencies automatically. Other than being a hassle (to resolve all the dependencies manually), manual resolution can mask dependency cycles or conflicts. [Wikipedia]

Package management

A software package management system (PMS) is a collection of software tools to automate the process of installing, upgrading, configuring, and removing software packages for a computer's operating system in a consistent manner. It typically maintains a database of software dependencies and version information to prevent software mismatches and missing prerequisites. Packages are distributions of software, applications and data. Packages also contain metadata, such as the software's name, description of its purpose, version number, vendor, checksum, and a list of dependencies necessary for the software to run properly. Upon installation, metadata is stored in a local package database. Distributions of Linux and other Unix-like systems typically consist of hundreds or even thousands of distinct software packages; in the former case, a package management system is a convenience, in the latter case it is essential. [Wikipedia]

Thinking: Why use standard libraries?

Key terms: dependency, library, package, package management system

To maximize your learning, please visit these Web sites and review their content to help reinforce the concepts presented in this section.

Quick links:
Package management system @ Wikipedia
Linux distribution @ Wikipedia
Software package @ Wikipedia
Dependency hell @ Wikipedia

Embedded Resources

Notes on navigation: Click inside the frame to navigate the embedded Web page. - Click outside the frame to navigate this page to scroll up/down between the embedded Web pages. - Click on the frame title to open that page in a new tab in most browsers. - Click on the the "Reload page" link to reload the original page for that frame.

Package management system @ Wikipedia | Reload page | If frame is empty, click on the link to view the page in a new tab or window

Linux distribution @ Wikipedia | Reload page | If frame is empty, click on the link to view the page in a new tab or window

Software package @ Wikipedia | Reload page | If frame is empty, click on the link to view the page in a new tab or window

Dependency hell @ Wikipedia | Reload page | If frame is empty, click on the link to view the page in a new tab or window

Sections: 1 | 2 | 3 | 4 | 5 | 6 | Index | Next >