# Error: this derivation has bad 'meta.outputsToInstall'

**URL:** https://discourse.nixos.org/t/error-this-derivation-has-bad-meta-outputstoinstall/20019
**Category:** Help
**Created:** [June 29, 2022, 9:43am UTC](https://discourse.nixos.org/t/error-this-derivation-has-bad-meta-outputstoinstall/20019 "2022-06-29T09:43:34Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![jtojnar](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jtojnar/32/70_2.png) [@jtojnar](https://discourse.nixos.org/u/jtojnar)
#### Post date: [June 29, 2022, 12:41pm UTC](https://discourse.nixos.org/t/error-this-derivation-has-bad-meta-outputstoinstall/20019/2 "2022-06-29T12:41:50Z")

</div>

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`](https://nixos.org/manual/nixpkgs/stable/#sec-declarative-package-management), or using [`home-manager`](https://github.com/nix-community/home-manager). See also [Declarative package management for normal users - #2 by Mic92](https://discourse.nixos.org/t/declarative-package-management-for-normal-users/1823/2).

* * *

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

---

_[View the full topic](https://discourse.nixos.org/t/error-this-derivation-has-bad-meta-outputstoinstall/20019)._
