Red Hat and Debian package managers function similarly but with architectural differences that affect Linux ad...
Linux package management uses repositories, which provide installation sources for software packages. Repositories automatically find and install package dependencies. Without system for repositories, dependency tracking can be an annoyance.
On current Linux distributions, there are two leading tools for software package management with repositories: Debian package management is found on Debian and derivatives, such as Ubuntu and Linux Mint; and the Red Hat package management is used on Red Hat Enterprise Linux (RHEL) and distributions of that ilk, like Fedora. Red Hat and Debian package management use a default package format. Red Hat uses .rpm; Debian-based distributions use .deb. These packages are compressed archives of software and metadata. The metadata provides information about the software version, as well as current dependencies.
Package database versus repositories can get confusing. Managing software packages through repositories makes working with these packages easier, but it also adds another database. That means information about packages can be obtained from multiple sources: the package database and the repository database.
Working with the package database
In both cases, the package database is the most important source of information concerning what is installed on a Linux server. The package database retrieves information from your server about currently installed software, which is useful since the package file is normally a rich source of documentation and software usage information.
On a Red Hat package manager-based server, use the rpm command to get information from the database. On a Debian-based server, use the dpkg command. For example, the dpkg -L command fetches a list of files associated with a package, or the rpm -ql command shows which files are included in one.
Working with repositories
To install new software and perform upgrades, system administrators work with repositories. Especially when updating servers, repositories are much more convenient: The package manager just needs to upload the new packages to make them automatically available, and the repository user transparently starts using them.
On Red Hat-based repositories, use the yum command to request package information and perform tasks, like updating and installing software. To do so, yum regularly downloads an updated repository index file.
On Debian-based systems, this index file needs to be manually uploaded, using the apt-get update command to update the package cache on the local machine. Once the package cache is uploaded, it is easy to install software packages and updates.
The system compares its list of packages in the repository to those installed on the local machine, determining if a package has been installed and if an update is available.
The system that deals with dependencies works particularly well: all current Linux distributions provide rich repositories that deliver necessary dependencies, which means that Linux admins hardly encounter 'dependency hell.'
It is more difficult to install software that is not in the repositories. Administrators can create their own repositories and copy local packages there. This also allows them to install custom packages from repositories, further decreasing dependency problems.
About the author:
Sander van Vugt is an independent trainer and consultant based in the Netherlands. He is an expert in Linux high availability, virtualization and performance. He has authored many books on Linux topics, including Beginning the Linux Command Line,Beginning Ubuntu LTS Server Administration and Pro Ubuntu Server Administration.
Learn more about the differences between Linux server OSes
Red Hat Package Manager: What you need to know