{"record":{"id":"87de28ee2a198c0c","repo":"abiosoft/colima","slug":"s-not-found-run-brew-install-s-to-install-87de28","errorCode":null,"errorMessage":"%s not found, run 'brew install %s' to install","messagePattern":"(.+?) not found, run 'brew install (.+?)' to install","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/qemu.go","lineNumber":12,"sourceCode":"package util\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n)\n\n// AssertQemuImg checks if qemu-img is available.\nfunc AssertQemuImg() error {\n\tcmd := \"qemu-img\"\n\tif _, err := exec.LookPath(cmd); err != nil {\n\t\treturn fmt.Errorf(\"%s not found, run 'brew install %s' to install\", cmd, \"qemu\")\n\t}\n\n\treturn nil\n}\n\n// AssertKrunkit checks if krunkit is available.\nfunc AssertKrunkit() error {\n\tif _, err := exec.LookPath(\"krunkit\"); err != nil {\n\t\treturn fmt.Errorf(\"krunkit not found in $PATH\\nInstall with: brew tap slp/krunkit && brew install krunkit\")\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/util/qemu.go#L1-L26","documentation":"AssertQemuImg checks exec.LookPath(\"qemu-img\") and reports that the binary is not on PATH, suggesting brew install qemu. It is a pure dependency check — nothing is executed. On Linux the brew hint is misleading: the qemu-utils (Debian/Ubuntu) or qemu-img (Fedora) package is the usual source of the binary.","triggerScenarios":"Calling util.AssertQemuImg (e.g. before qcow2 disk operations) when qemu-img is not installed, or its directory (/opt/homebrew/bin, /usr/local/bin) is missing from PATH in the invoking shell, CI step, or container.","commonSituations":"Fresh machine without qemu; GUI-launched or CI shells that skip profile setup so Homebrew's bin dir is absent; running inside a container without qemu packages.","solutions":["Install it: brew install qemu (macOS) or sudo apt install qemu-utils (Debian/Ubuntu) / sudo dnf install qemu-img (Fedora)","Ensure the Homebrew bin dir is on PATH, e.g. eval \"$(brew shellenv)\" in the invoking shell or CI config","Verify with qemu-img --version before retrying","For containers, add qemu-utils to the image"],"exampleFix":"# before: check fails\n$ qemu-img --version\nzsh: command not found: qemu-img\n\n# after\n$ brew install qemu            # macOS\n$ sudo apt install qemu-utils   # Debian/Ubuntu\n$ qemu-img --version","handlingStrategy":"validation","validationCode":"if _, err := exec.LookPath(\"qemu-img\"); err != nil {\n    return fmt.Errorf(\"qemu-img missing: brew install qemu (macOS) or apt install qemu-utils (Linux)\")\n}\nerr := util.AssertQemuImg()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check for qemu-img during setup, before any qcow2 operation needs it","In CI and GUI shells, eval \"$(brew shellenv)\" so Homebrew binaries are on PATH","On Linux hosts, install qemu-utils — the error's brew suggestion is macOS-only"],"tags":["qemu","dependencies","path","installation"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}