{"record":{"id":"bc2cb7ac5e54ff97","repo":"jdx/mise","slug":"mise-is-installed-via-a-package-manager-cannot-up","errorCode":null,"errorMessage":"mise is installed via a package manager, cannot update","messagePattern":"mise is installed via a package manager, cannot update","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/self_update.rs","lineNumber":202,"sourceCode":"        .encode_wide()\n        .last()\n        .is_some_and(|c| c == u16::from(b'\\\\') || c == u16::from(b'/'))\n}\n\n/// The file stem `self-replace` would put in the helper's name: the running executable's.\n#[cfg(windows)]\nfn current_exe_stem() -> Option<String> {\n    let exe = std::env::current_exe().ok()?;\n    exe.file_stem().and_then(|s| s.to_str()).map(str::to_owned)\n}\n\nimpl SelfUpdate {\n    pub async fn run(self) -> Result<()> {\n        if !Self::is_available() && !self.force {\n            if let Some(instructions) = upgrade_instructions_text() {\n                warn!(\"{}\", instructions);\n            }\n            bail!(\"mise is installed via a package manager, cannot update\");\n        }\n        #[cfg(windows)]\n        Self::ensure_temp_dir_can_replace_binary()?;\n        // Before the update, not after: this run is about to create a copy of its own, and that one\n        // is in use rather than stale.\n        #[cfg(windows)]\n        sweep_helper_orphans();\n        let status = self.do_update()?;\n\n        if status.updated() {\n            let version = status.version().to_string();\n            let styled_version = style(&version).bright().yellow();\n            miseprintln!(\"Updated mise to {styled_version}\");\n            // On Windows, \"exe\"/\"hardlink\" shims are copies of mise-shim.exe and\n            // go stale after an update. Refresh mise-shim.exe, and ONLY if that\n            // succeeds rebuild the shim copies from it. Reshimming on failure\n            // would re-copy the OLD mise-shim.exe yet still stamp the new version\n            // in the `.version` marker, masking the staleness from future","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/self_update.rs#L184-L220","documentation":"`mise self-update` refuses when the install is marked as package-manager-owned. is_available() returns false when MISE_SELF_UPDATE_DISABLED_PATH (marker file shipped by Homebrew and the AUR mise-bin package) or MISE_SELF_UPDATE_INSTRUCTIONS is set, or MISE_SELF_UPDATE_AVAILABLE=false. mise first warns with the packager's instructions (if any) then bails — unless --force is passed, which bypasses the guard.","triggerScenarios":"`mise self-update` on a Homebrew/AUR/apt-managed install, or in any environment where the packager set MISE_SELF_UPDATE_INSTRUCTIONS/DISABLED_PATH, or MISE_SELF_UPDATE_AVAILABLE=false was exported.","commonSituations":"brew users running self-update out of habit and getting a brew-specific instruction block; corporate images that pin mise via a package manager; MISE_SELF_UPDATE_AVAILABLE exported in a dotfile.","solutions":["Update through the owning package manager (e.g. `brew upgrade mise`, `paru -Syu mise-bin`)","Switch to the self-updating official install: curl script from mise.jdx.dev, then `mise self-update` works","Only if you accept overwriting the packaged binary: `mise self-update --force` (package DB will disagree with the binary afterwards)"],"exampleFix":"# before\nmise self-update        # Homebrew install -> bail\n# after\nbrew upgrade mise       # or reinstall via the official curl script","handlingStrategy":"validation","validationCode":"# bash: detect a package-managed install before attempting self-update\nif [ -n \"${MISE_SELF_UPDATE_INSTRUCTIONS:-}${MISE_SELF_UPDATE_DISABLED_PATH:-}\" ] \\\n   || [ \"${MISE_SELF_UPDATE_AVAILABLE:-}\" = \"false\" ]; then\n  echo \"self-update unavailable; use the owning package manager\" >&2\n  exit 2\nfi\nmise self-update","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize one install channel per fleet (either package manager or official script) so update paths never mix","Never use `--force` on packaged installs; it desyncs the package database from the binary"],"tags":["self-update","package-manager","homebrew","environment"],"backgroundTag":"self-update-disabled","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}