kubernetes/kops · error

package repair not supported on RHEL/CentOS

Error message

package repair not supported on RHEL/CentOS

What it means

RenderLocal in the nodeup Package task attempts to repair a broken dpkg state by running `dpkg --configure -a` on Debian-family hosts. When the host is RHEL/CentOS-family, no equivalent repair path is implemented, so the task returns this error instead of proceeding with undefined behavior. It is an explicit guard against an unsupported OS family.

Solutions

  1. Use a Debian-family (Ubuntu/Debian) AMI when your cluster config defines Package tasks that may need repair.
  2. Ensure the Package task reaches a healthy state on RHEL so the repair branch is never entered (pre-install packages via the image, or fix yum repo issues).
  3. If RHEL support is needed, add a repair path (e.g. `rpm --rebuilddb` / dnf equivalents) gated on TagOSFamilyRHEL in package.go.

Example fix

// before (cluster.yaml)
kubernetesVersion: v1.28.3
machineType: m5.large  # RHEL AMI
// after: provision from Ubuntu image or avoid Package repair on RHEL
ami: ami-0ubuntu...
Defensive patterns

Strategy: validation

Validate before calling

if isRHELFamily() && taskRequiresPackageRepair() {
    return errors.New("precondition failed: package repair unsupported on RHEL/CentOS")
}

Prevention

When it happens

Trigger: A Package task's changes require repair (Healthy was set and repair path entered) while nodeup runs on an RHEL-family host where the package manager is not TagOSFamilyRHEL-tagged with a repair implementation.

Common situations: Running nodeup on an AMI built from RHEL/CentOS/Rocky/Alma and having a package task drift into an unhealthy/repair state; mixing Debian-based and RHEL-based machine images in the same cluster.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/edf588d435b0220a. Report an issue: GitHub.

Appendix: source

Thrown at upup/pkg/fi/nodeup/nodetasks/package.go:401

			return fmt.Errorf("error installing package %q: %v: %s", e.Name, err, string(output))
		}
		// Successful package install, updating the last updated time.
		packageManagerLastUpdated = time.Now()
	} else {
		if changes.Healthy != nil {
			if d.IsDebianFamily() {
				args := []string{"dpkg", "--configure", "-a"}
				klog.Infof("package is not healthy; running command %s", args)
				cmd := exec.Command(args[0], args[1:]...)
				output, err := cmd.CombinedOutput()
				if err != nil {
					return fmt.Errorf("error running `dpkg --configure -a`: %v: %s", err, string(output))
				}

				changes.Healthy = nil
			} else if d.IsRHELFamily() {
				// Not set on TagOSFamilyRHEL, we can't currently reach here anyway...
				return fmt.Errorf("package repair not supported on RHEL/CentOS")
			} else {
				return fmt.Errorf("unsupported package system")
			}
		}

		if !reflect.DeepEqual(changes, &Package{}) {
			klog.Warningf("cannot apply package changes for %q: %+v", e.Name, changes)
		}
	}

	return nil
}

View on GitHub (pinned to 4c8573c808)