# \`command-not-found\` unable to open database

**URL:** https://discourse.nixos.org/t/command-not-found-unable-to-open-database/3807
**Category:** Help
**Created:** [August 23, 2019, 10:02am UTC](https://discourse.nixos.org/t/command-not-found-unable-to-open-database/3807 "2019-08-23T10:02:45Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![wizzup](https://discourse.nixos.org/user_avatar/discourse.nixos.org/wizzup/32/1178_2.png) [@wizzup](https://discourse.nixos.org/u/wizzup)
#### Post date: [August 26, 2019, 9:19am UTC](https://discourse.nixos.org/t/command-not-found-unable-to-open-database/3807/5 "2019-08-26T09:19:07Z")

</div>

This works! Do I need to do this command sequences every time after `nixos-rebuild switch`?

```auto
[root@earth:~]# nix-channel --add https://nixos.org/channels/nixos-unstable nixos

[root@earth:~]# nix-channel --list
nixos https://nixos.org/channels/nixos-unstable

[root@earth:~]# nix-channel --update
unpacking channels...

[root@earth:~]# command-not-found hello
The program ‘hello’ is currently not installed. It is provided by
several packages. You can install it by typing one of the following:
  nix-env -iA nixos.hello
  nix-env -iA nixos.mbedtls
  nix-env -iA nixos.perkeep

```

---

_[View the full topic](https://discourse.nixos.org/t/command-not-found-unable-to-open-database/3807)._
