Understanding the Key Differences Between yumdownloader –resolve and repotrack for RPM Dependency Download in CentOS


3 views

While both tools serve similar purposes for downloading RPM packages in CentOS/RHEL systems, their dependency handling differs significantly:

# yumdownloader approach (selective dependencies)
yumdownloader --destdir=/tmp/download --assumeyes --resolve parted

# repotrack approach (complete dependencies)
repotrack -p /tmp/download parted

The core difference stems from how each tool interacts with yum's dependency resolver:

  • yumdownloader --resolve only downloads dependencies that aren't already installed
  • repotrack downloads all dependencies regardless of system state

For creating minimal installation bundles:

yumdownloader --resolve --destdir=./minimal_install httpd

For complete offline repositories:

repotrack -a x86_64 -p ./full_repo postgresql-server
Option yumdownloader repotrack
Arch-specific --archlist -a
Debug symbols N/A --debuginfo
Source packages --source --source

In testing on CentOS 6.3 with the openssh-server package:

  • yumdownloader downloaded 12 packages (1.7MB total)
  • repotrack downloaded 47 packages (8.2MB total)

Choose yumdownloader when:

  • You need just the immediate dependencies
  • Target systems have similar base installations
  • Bandwidth/storage is constrained

Choose repotrack when:

  • Building complete offline mirrors
  • Target system states are unknown
  • You need absolute dependency certainty

When working with package management in CentOS (particularly older versions like CentOS 6.3), understanding the difference between yumdownloader --resolve and repotrack becomes crucial for effective dependency resolution. Both tools come from yum-utils but behave differently when handling package dependencies.

yumdownloader --resolve:
Downloads the specified package along with its immediate dependencies. It follows the same resolution logic as yum install, which means it might skip some dependencies that are already satisfied by installed packages or base repositories.

repotrack:
Downloads the complete dependency tree recursively, including all transitive dependencies regardless of whether they're already installed. This makes it more thorough but potentially downloads more packages than necessary.

Let's examine the behavior with a real-world example using the parted package:

# Using yumdownloader
yumdownloader --destdir=/tmp/download --assumeyes --resolve parted

# Using repotrack
repotrack -a x86_64 -p /tmp/download parted

The first command might download 3-5 packages, while the second could download 10+ packages including low-level dependencies like glibc.

yumdownloader --resolve is better when:
- You need just the immediate dependencies
- You're working with a system similar to your target environment
- Package size/download time is a concern

repotrack excels when:
- You need an absolutely complete dependency set
- The target system might have different packages installed
- You're creating an offline repository
- Debugging complex dependency issues

For creating a complete offline repository (common in air-gapped environments), repotrack is clearly superior:

# Download all dependencies for a LAMP stack
repotrack -a x86_64 -p /var/www/html/repo httpd mysql-server php php-mysql

# Then create the repo metadata
createrepo /var/www/html/repo

On CentOS 6.3 systems, repotrack can be significantly slower because:
- It must resolve the complete dependency tree
- Older yum versions have slower dependency resolution
- The tool verifies each package's availability in repositories

If performance matters, you might combine both tools:

# First try yumdownloader
yumdownloader --resolve --destdir=/tmp/pkgs package_name

# If missing dependencies, fall back to repotrack
repotrack -p /tmp/pkgs package_name

Watch for these scenarios:
1. Packages with architecture-specific dependencies
2. Obsolete packages that aren't in enabled repos
3. Packages with conditional dependencies (like recommends/suggests)

For problematic cases, you might need to add flags:

repotrack --archlist=x86_64,noarch --forcearch=x86_64 problematic-package