kubernetes/kops · error

error installing package %q: %v: %s

Error message

error installing package %q: %v: %s

What it means

Error "error installing package %q: %v: %s" thrown in kubernetes/kops.

Source

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

		output, err := cmd.CombinedOutput()
		if err != nil {
			// This is a bit of a hack, but if we get an error that says we need to run dpkg configure, we run it.
			// The typical cause is that we install a package that kills nodeup,
			// also killing apt-get, and then apt-get is in a bad state.
			// Typical error looks like this:
			// exit status 100: E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
			if strings.Contains(string(output), "dpkg --configure -a") {
				klog.Warningf("found error requiring dpkg repair: %q", string(output))
				args := []string{"dpkg", "--configure", "-a"}
				klog.Infof("Running command %s", args)
				cmd := exec.Command(args[0], args[1:]...)
				dpkgOutput, err := cmd.CombinedOutput()
				if err != nil {
					return fmt.Errorf("error running `dpkg --configure -a`: %v: %s", err, string(dpkgOutput))
				}
				// Note that we still return an error, because our package installation failed; we will retry.
			}
			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")

View on GitHub (pinned to 4c8573c808)

When it happens

Trigger: Thrown at upup/pkg/fi/nodeup/nodetasks/package.go:383 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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