{"record":{"id":"8f7d1f09fca42fbb","repo":"Hmbown/CodeWhale","slug":"the-package-managed-executable-was-not-changed","errorCode":null,"errorMessage":"The package-managed executable was not changed.","messagePattern":"The package-managed executable was not changed\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/update.rs","lineNumber":75,"sourceCode":"    let channel = ReleaseChannel::from_beta_flag(beta);\n    let current_version = env!(\"CARGO_PKG_VERSION\");\n    let proxy = proxy_arg\n        .as_deref()\n        .map(validate_and_build_proxy)\n        .transpose()?;\n\n    println!(\"Checking for {} updates...\", channel.label());\n    println!(\"Current binary: {}\", current_exe.display());\n    println!(\"Current version: v{current_version}\");\n    if legacy_binary {\n        println!();\n        println!(\"{}\", legacy_binary_message(&current_exe));\n    }\n    if let Some(warning) = managed_install_warning(install_method) {\n        println!();\n        println!(\"{warning}\");\n        if !check_only {\n            bail!(\"The package-managed executable was not changed.\");\n        }\n    }\n    if protected_location {\n        println!(\n            \"System/package directory: in-place self-update is disabled.\\n\\n{GITHUB_MIGRATION_HELP}\"\n        );\n        if !check_only {\n            bail!(\"The system/package executable was not changed.\");\n        }\n    }\n\n    if check_only {\n        let fetched = fetch_latest_release(channel, proxy.as_ref())\n            .with_context(update_network_fallback_hint)?;\n        let latest_tag = &fetched.release.tag_name;\n        println!(\"Latest {} release: {latest_tag}\", channel.label());\n        if update_is_needed(channel, current_version, latest_tag)? {\n            if install_method.supports_self_update() && !protected_location {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/update.rs#L57-L93","documentation":"run_update detects that the running executable came from a package-managed install (apt, brew, etc.) via managed_install_warning. Self-update must not overwrite a file owned by the system package manager, so when the update is not a --check run it bails, leaving the executable unchanged and directing the user to update via their package manager or migrate to the GitHub release channel.","triggerScenarios":"Running the self-update command on a binary installed through a package manager (install_method reports a managed install) without --check only.","commonSituations":"Installing via apt/dnf/brew/scoop then running `codewhale update`; CI scripts that auto-update the binary regardless of install source; upgrading a package-managed install whose repo version is stale.","solutions":["Update through the package manager instead: e.g. `apt upgrade`, `brew upgrade`, `dnf upgrade`.","Migrate to the GitHub release channel by installing the official binary over the package-managed one, then self-update will work.","Use the update command with --check to see available versions without attempting to modify the executable.","Uninstall the package-managed copy and install from GitHub releases before updating."],"exampleFix":"// before\ncodewhale update   # fails on package-managed install\n// after\nbrew upgrade codewhale   # or: codewhale update --check","handlingStrategy":"fallback","validationCode":"codewhale update --check   # inspects install_method without modifying anything","typeGuard":null,"tryCatchPattern":"// shell\nif ! codewhale update --check; then\n  brew upgrade codewhale || apt-get install --only-upgrade codewhale\nfi","preventionTips":["Record how the binary was installed and always update through that channel.","Run `update --check` in CI instead of unconditional self-update.","Prefer user-directory installs (e.g. cargo/homebrew-managed user dirs) for machines where you want self-update to work."],"tags":["cli","self-update","package-manager"],"backgroundTag":"unsupported-operation","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}