Skip to content

centos-drp-only-repos Overwrites yum Repo Configuration

Running the centos-drp-only-repos task on a machine that is booted into its local OS (bootenv: local) will overwrite /etc/yum.repos.d/, removing all existing repository configuration.

Problem

The centos-drp-only-repos task is designed to replace the system's yum repository configuration with one that points only to the DRP endpoint. This is intentional during OS installation, when the machine is running under Sledgehammer or a CentOS install bootenv. If the task runs while the machine is booted into its installed OS (bootenv: local), the result is the same — all files in /etc/yum.repos.d/ are overwritten and the previous repo configuration is lost.

Symptoms include:

  • yum or dnf commands fail with repository errors after a DRP workflow runs
  • /etc/yum.repos.d/ contains only DRP-generated repo files
  • Package installs fail on machines that previously worked

Resolution

Only include centos-drp-only-repos in workflows or stages that run while the machine is booted into Sledgehammer or a CentOS install bootenv. Do not include it in any workflow that runs after the machine has transitioned to bootenv: local.

If a machine has already had its repos overwritten, restore the standard CentOS repository configuration manually:

Bash
# CentOS 7
yum install -y centos-release

# Or restore from a known-good backup if one exists

Prevention

When building workflows that include centos-drp-only-repos, verify the preceding step sets the bootenv to an install environment (e.g. bootenv:centos-7-install) before the task runs. A safe workflow sequence looks like this:

Text Only
bootenv:sledgehammer
erase-disks
stage:centos-7-install
bootenv:centos-7-install
set-hostname
centos-drp-only-repos     ← runs inside the install bootenv, not the local OS
ssh-access
...
bootenv:local

Never place centos-drp-only-repos after a bootenv:local step.


Additional Information

See Also

Keywords

centos, yum, repos, yum.repos.d, centos-drp-only-repos, repository, overwrite

Revision Information

Text Only
KB Article     :  kb-00087
initial release:  2026-03-27
updated release:  2026-03-27