jdx/mise · error

{} does not support declarative package removal

Error message

{} does not support declarative package removal

What it means

The package provider trait's default remove() is intentionally unimplemented: providers that cannot declaratively uninstall (such as mas, where App Store apps aren't removed via install/uninstall symmetry) hit this default and bail naming the provider. The caller attempted `state = "absent"` for a backend lacking removal support.

Source

Thrown at src/system/packages/mod.rs:205

    /// This is *availability*, not installed state — [`Self::installed`]
    /// cannot answer it (apt's asks dpkg, which only knows what is already on
    /// the box). Used to resolve a plugin's candidate package names, where the
    /// same capability is packaged under different names across distro
    /// releases. Must be side-effect free and never elevate.
    ///
    /// The default reports every name as available, which makes candidate
    /// resolution pick the first one — the behavior before candidate lists
    /// existed. Managers override it where the query is cheap.
    async fn available(&self, names: &[String]) -> Result<Vec<bool>> {
        Ok(vec![true; names.len()])
    }

    /// Install the given packages (already filtered to missing, mismatched, or repairable).
    async fn install(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()>;

    /// Remove packages declared with `state = "absent"`.
    async fn remove(&self, _pkgs: &[PackageRequest], _opts: &InstallOpts) -> Result<()> {
        eyre::bail!(
            "{} does not support declarative package removal",
            self.name()
        )
    }

    fn supports_remove(&self) -> bool {
        false
    }

    /// Install with manager-specific declarative options. Managers without
    /// additional package options use the ordinary install path unchanged.
    async fn install_with_options(
        &self,
        pkgs: &[PackageRequest],
        opts: &InstallOpts,
        _manager_options: &ManagerPackageOptions,
    ) -> Result<()> {
        self.install(pkgs, opts).await

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Remove the `state = "absent"` declaration for packages from this provider
  2. Uninstall the app manually (e.g. via Launchpad/Finder for mas apps)
  3. Use a provider that supports removal for that package if declarative removal is required
  4. Check supports_remove()/docs to learn which providers support absent state

Example fix

// before
[[packages]]
provider = "mas"
name = "497799835"
state = "absent"
// after: uninstall manually; keep config limited to present-state mas apps
[[packages]]
provider = "mas"
name = "497799835"
Defensive patterns

Strategy: validation

Validate before calling

if pkg.state == Absent && !provider.supports_remove() {
    eprintln!("provider {} cannot remove packages; handle manually", provider.name());
}

Try / catch

match provider.remove(&absent, &opts).await {
    Err(e) if e.to_string().contains("does not support declarative package removal") => {
        eprintln!("skipping: uninstall these packages manually");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Declaring a package with `state = "absent"` for a provider whose supports_remove() is false, so the trait's default remove() runs and immediately fails with the provider name in the message.

Common situations: Users migrating an Ansible-style declarative package manifest to mise and marking Mac App Store apps absent; removing packages from a config without checking provider capabilities.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/0999c99de172400c. Report an issue: GitHub.