Version 2 (modified by james, 6 years ago)
--

Some yum usage for people who know "apt"

If you are familiar with the apt package manager on Debian/Ubuntu this page should help you transfer your knowledge to working with yum on Fedora/RHEL/CentOS/etc.

Note that this page as currently written is by non-apt experts, so there may be some mistakes.

General points

  • Speed: apt on Debian deals with roughly ~37,000 packages[1] and an extra 6,500 "provides"[2]. yum on Fedora deals with roughly 24,000 packages, 143,000 provides and 3,100,000 file provides.
  • Caching: apt uses manual caching and yum uses automatic caching. You can convert to manual caching by setting metadata_expire=never and manually running "yum makecache", this is rarely a good idea.
  • Packaging: apt is packaged in the "apt-get" package, and extended through a number of "apt-*" packages (like apt-file). yum is packages as "yum" and extended via. "yum-utils" and a number of plugins "yum-plugin-*" and "yum-*-plugin" and also a number of packages that use the yum API (like mock or rhn-check).

Simple conversion

For some of the basic packaging operations, apt and yum are basically identical.

  • apt-get install
    • yum install
  • apt-get upgrade
    • yum upgrade
  • apt-get remove
    • yum remove
  • apt-get --reinstall install
    • yum reinstall
  • apt-get install foo=1.0 (to downgrade to version 1.0)
    • yum downgrade foo-1.0
  • apt-get clean
    • yum clean
  • apt-get build-dep
    • yum-builddep
  • dpkg -l
    • yum list installed
  • apt-cache search
    • yum search
  • apt-cache search --names-only
    • yum list
    • repoquery

Not so simple conversions

These are "similar" operations, but there are some differences in how they act.

  • apt-cache show
    • yum info
    • repoquery -i
  • apt-get purge
    • yum remove
  • apt-get dist-upgrade
    • yum upgrade
    • yum distro-sync
  • apt-get source
    • yumdownloader --source
  • dpkg --get-selections
    • yum-debug-dump
  • dpkg --set-selections
    • yum-debug-restore

Groups of packages

In apt there is no concept of "groups", where as yum has this concept via. "yum group".

In both apt and yum you can create/use a "metapackage", which is a package which contains no data but has dependency information (normally requires on other packages). These metapackages are used in both apt and yum managed distributions to make installation simpler (Eg. xorg-x11-drivers and xserver-xorg-video-all).

Due to the lack of groups in apt metapackages are sometimes created/used with apt where a group is used in yum (Eg. @buildsys-build and build-essential). yum has specific commands which can operate on a "group id" or a translated "group name", "yum group install" "yum group remove" etc. Also the main commands can operate on groups via. the @ prefix "yum install @core" etc.


[1] apt-cache dump | egrep "Package" | wc -l

[2] apt-cache show ".*" | fgrep "Provides" | tr , '\n' | wc -l