{"record":{"id":"18add6c2d2fee0ae","repo":"kubernetes/kops","slug":"error-installing-package-q-v-s","errorCode":null,"errorMessage":"error installing package %q: %v: %s","messagePattern":"error installing package %q: (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/nodeup/nodetasks/package.go","lineNumber":383,"sourceCode":"\t\toutput, err := cmd.CombinedOutput()\n\t\tif err != nil {\n\t\t\t// This is a bit of a hack, but if we get an error that says we need to run dpkg configure, we run it.\n\t\t\t// The typical cause is that we install a package that kills nodeup,\n\t\t\t// also killing apt-get, and then apt-get is in a bad state.\n\t\t\t// Typical error looks like this:\n\t\t\t// exit status 100: E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.\n\t\t\tif strings.Contains(string(output), \"dpkg --configure -a\") {\n\t\t\t\tklog.Warningf(\"found error requiring dpkg repair: %q\", string(output))\n\t\t\t\targs := []string{\"dpkg\", \"--configure\", \"-a\"}\n\t\t\t\tklog.Infof(\"Running command %s\", args)\n\t\t\t\tcmd := exec.Command(args[0], args[1:]...)\n\t\t\t\tdpkgOutput, err := cmd.CombinedOutput()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"error running `dpkg --configure -a`: %v: %s\", err, string(dpkgOutput))\n\t\t\t\t}\n\t\t\t\t// Note that we still return an error, because our package installation failed; we will retry.\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"error installing package %q: %v: %s\", e.Name, err, string(output))\n\t\t}\n\t\t// Successful package install, updating the last updated time.\n\t\tpackageManagerLastUpdated = time.Now()\n\t} else {\n\t\tif changes.Healthy != nil {\n\t\t\tif d.IsDebianFamily() {\n\t\t\t\targs := []string{\"dpkg\", \"--configure\", \"-a\"}\n\t\t\t\tklog.Infof(\"package is not healthy; running command %s\", args)\n\t\t\t\tcmd := exec.Command(args[0], args[1:]...)\n\t\t\t\toutput, err := cmd.CombinedOutput()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"error running `dpkg --configure -a`: %v: %s\", err, string(output))\n\t\t\t\t}\n\n\t\t\t\tchanges.Healthy = nil\n\t\t\t} else if d.IsRHELFamily() {\n\t\t\t\t// Not set on TagOSFamilyRHEL, we can't currently reach here anyway...\n\t\t\t\treturn fmt.Errorf(\"package repair not supported on RHEL/CentOS\")","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/nodeup/nodetasks/package.go#L365-L401","documentation":"Error \"error installing package %q: %v: %s\" thrown in kubernetes/kops.","triggerScenarios":"Thrown at upup/pkg/fi/nodeup/nodetasks/package.go:383 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}