DBI connect error in nixos

Posted on Mar 6, 2024

After fresh nix install, i keep getting this error when I put uninstalled commands in the cli, following is the fix

λ <some_command>
DBI connect('dbname=/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite','',...) failed: unable to open database file at /run/current-system/sw/bin/command-not-found line 13.
cannot open database `/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite' at /run/current-system/sw/bin/command-not-found line 13.

λ nix-channel --add https://nixos.org/channels/nixos-<unstable/23.11> nixos

λ nix-channel --list                                                                                   ~
nixos https://nixos.org/channels/nixos-23.11

λ sudo nix-channel --update nixos