Error: this derivation has bad 'meta.outputsToInstall'

Imperative package management with nix-env is currently based on package names (the name attribute returned by calling builtins.parseDrvName on the value of name attribute) by default. This means that when you try to update, Nix will scan the package set for a package with the same name as the «pkg»/each package you have installed (see the list with nix-env -q).

The issue with package names is that Nix needs to scan all packages in the set to find a match, making nix-env -u slow. Additionally, package names can be ambiguous.

Generally, I would recommend to use attribute paths to install (nix-env -iA «attrPath») and update (nix-env -uA «attrPath») individual packages as they fix both aforementioned issues. Unfortunately, nix-env does not record the attribute paths so updating all packages with nix-env -u will fall back to package name-based matching.

For that reason, I would recommend avoiding imperative package management in favour of declarative one. Either with nix-env, or using home-manager. See also Declarative package management for normal users - #2 by Mic92.


As for the error itself, could you share what package name are you trying to update and what Nixgkgs revision your channel points to?