01. Package management

In this short series, we'll go over package management - an essential tool for both beginner Linux users and the more seasoned system adminstrators. Package management will help you seamlessly install, upgrade and maintain software. This series will cover Debian (Ubuntu) package management for now, but we will also include lessons for Red Hat in a future lesson.

A time before package management

Long ago when software wasn't as abundant as it is today, package management was nonexistent. This meant that users had to individually download and compile source code when installing software, a process that was redundant as it was time consuming. Additionally, software that required other dependencies had to be installed separately, making the process of installing large software systems incredibly tedious. With the number of software in a person's computer increasing, so did their complexity of management, as upgrading systems had to be performed manually.

Why can't I manage all these software packages?
A user attempting to manage software packages without a package management system.

How do package managers help?

Nowadays, almost all platforms come with a designated package management system. Package managements allow you to install, upgrade, configure and remove software packages from your computer's system. At the heart of this system is a database that contains information about your softwares' last-upgrade dates, dependencies, version number, and more. Package managers allow you to conveniently manage all the software without a sweat.

How package management changed the development community

Not only has package management allowed for users to easily download and maintain software, but it has also forced developers to uphold a strict convention as to how their software is structured.

Furthermore, we now have software available in packages, with information about dependencies, and version numbers. This allows us to keep track of bug information and whether it is necessary to download security patches.

What Package Managerment software is available?

Depending on your Linux distribution, (Debian, Red Hat or SUSE), or platform (OS X), we have different package management software and tools.

SUSE, redhat and Debian.
Package management software depends on which Linux distro you use: SUSE, redhat and Debian.

For the Debian distribution, which includes Linux Mint, Ubuntu, Debian, and Linspire, packages come in .deb files, and use tools like apt and dpkg.

Red Hat, which includes CentOS, Fedora, Mandrivia and OpenSuSE, use packaging tools rpm and yum.

For OS X, you can use Homebrew.

Review of some terminology before we begin

Package file

From the perspective of a package management system, a package file contains all the data files and programs that support the software. This is where all the metadata is found, including a description of its contents, version number and more. This also includes scripts that run before and after the installion is performed.


Dependencies are additional packages required by the principal package in order to function propertly. In short, it is a piece of software that is required for another to run. For example, if the year were 2004 and I wanted to watch a funny animation on the web, I would have to first install Adobe Flash Player. Thus, Adobe Flash Player serves as a dependency to flash animation videos.

Package managers maintain dependency information, allowing the system to know whether it needs to pull anything other programs in.


Libraries are software components that can be shared by many different programs. This allows a reduction in disk space and memory requirements, as multiple programs are allowed to access the same files.


The package management system uses checksums to validate and verify installed software. Checksums allows the computer to check for disk errors or accidental overwrites of files.

Sign in a root

To use any commands that have to deal with package management, you'll need to be signed in as root. To do so, use the sudo -s command, and put in your system's password when prompted.

Take your Linux skills to the next level!

The Linux Command Line

Take your Linux skills to the next level! Try Linux & UNIX

The Linux Command Line takes you from your very first terminal keystrokes to writing full programs in Bash, the most popular Linux shell. Along the way you'll learn the timeless skills handed down by generations of gray-bearded, mouse-shunning gurus: file navigation, environment configuration, command chaining, pattern matching with regular expressions, and more.

$ Check price
39.9539.95Amazon 4.5 logo(274+ reviews)

More Linux & UNIX resources

Want to avoid becoming a code monkey?

Code Complete 2

Want to avoid becoming a code monkey? Try Good Practice

This book synthesizes the most effective techniques and must-know principles into clear, pragmatic guidance. No matter what your experience level, development environment, or project size, this book will inform and stimulate your thinking - and help you build the highest quality code.

$ Check price
54.9954.99Amazon 4.5 logo(291+ reviews)

More Good Practice resources