arrow_back
Back

Linux package managers: APT, RPM, and YUM

Andrew Dorokhov Andrew Dorokhov schedule 2 min read
menu_book Table of Contents

APT

Advanced Package Tool (APT) is the package manager on Debian and Ubuntu. Install packages with apt install, update indexes with apt update, and upgrade with apt upgrade.

RPM (Red Hat Package Manager)

Red Hat introduced RPM in 1995. Today it is used to build packages that follow the open_in_new Linux Standard Base (LSB) specification. The rpm command groups options into three areas:

  • Querying and verifying packages.
  • Installing, upgrading, and removing packages.
  • Miscellaneous operations.

Drawback

rpm does not resolve dependencies automatically. The upside: you can install several packages in one command, and if you already have all dependency RPMs on disk, they install in the correct order.

RPM package file names

RPM files usually look like foo-1.0-1.i386.rpm:

  • package name (foo)
  • version (1.0)
  • release (1)
  • architecture (i386)

Install an RPM package

rpm -i <full-package-name>

Query installed packages

Check whether a package is installed (-q = query). You can pass the short package name:

rpm -q httpd

More detail with -i (information):

rpm -qi httpd

List files belonging to an installed package (-ql):

rpm -ql httpd

List all installed packages:

rpm -qa

YUM (Yellowdog Updater Modified)

YUM is the higher-level front end to RPM on RHEL, CentOS, and related distros. It resolves dependencies and works with remote repositories.

Repository layout

Package sources live on remote servers (repositories). Repo definitions are in /etc/yum.repos.d/:

ls -lha /etc/yum.repos.d/

Additional repo paths can be set in /etc/yum.conf.

Install a package

Unlike raw rpm, YUM accepts the short package name (no version or architecture suffix):

yum install <short-package-name>

Search and list packages

All installed and available packages:

yum list

Installed only:

yum list installed

List enabled repositories

yum repolist

Third-party repositories

EPEL

open_in_new EPEL (Extra Packages for Enterprise Linux) is a community repo with add-on packages for RHEL, CentOS, and Scientific Linux.

CentOS 7 — install via rpm:

rpm -Uvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Or from base repos (preferred):

yum install epel-release

Remi

PHP and related packages for multiple versions. Mirrors: open_in_new https://rpms.remirepo.net

CentOS 7:

rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Or:

yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Webtatic

CentOS 7:

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

Apache HTTP Server on Linux: install, config, and virtual hosts

arrow_forward