【问题标题】:command-not-found not working because programs.sqlite is missingcommand-not-found 不工作,因为programs.sqlite 丢失
【发布时间】:2016-07-09 07:03:03
【问题描述】:

我在不稳定的 nix 频道:

# nix-channel --list
nixos https://nixos.org/channels/nixos-unstable
# nix-channel --update
downloading Nix expressions from ‘https://nixos.org/releases/nixos/unstable/nixos-16.09pre78848.9549257//nixexprs.tar.xz’...
downloading ‘https://nixos.org/releases/nixos/unstable/nixos-16.09pre78848.9549257//nixexprs.tar.xz’... [ [6192/6921 KiB, 6143.1 KiB/s]
unpacking channels...

由于某种原因,command-not-found 不起作用:

$ command-not-found
/home/fabian command-not-found 
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/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite 不存在。这可能是什么原因?

【问题讨论】:

    标签: nix nixos


    【解决方案1】:

    FWIW,似乎 nixos-install 无法正确生成 programs.sqlite

    我在全新的 17.03 安装中看到了同样的错误,即使它在我拥有的其他系统上也可以在 17.03 上运行。

    手动运行nix-channel --update 是为我修复它所需要的。 (我没有运行nixos-rebuild 或任何会改变command-not-found 版本的东西。)

    【讨论】:

      【解决方案2】:

      显然它已在最新的频道/nixos 版本中被删除并等待替换 - 参考 (1) (2)

      【讨论】:

      • 这些 github 问题有时很难找到...谢谢(即使这不是我希望的答案)
      • 是的,nixOS 存储库肯定很忙。至于 command-not-found 程序,它无论如何都不存在于非 nixOS 系统上。我的本机系统就是这种情况。我使用带有 -qas 标志的 nix-env 来检查包的可用性,也许在这种情况下这也是一个有用的替代品。
      • 好吧,我喜欢它来确定哪个包包含可执行文件。我也喜欢NIX_AUTO_RUN 的全新功能。但是,这就是生活。对于 nix-env 命令,我会添加 -P 以获取属性路径。
      • 现在又开始行动了。
      • 再次禁用并显然再次修复(尽管可能尚不可用):github.com/NixOS/nixos-channel-scripts/issues/9
      猜你喜欢
      • 2016-01-06
      • 2021-06-17
      • 2019-07-07
      • 2020-09-26
      • 2018-02-18
      • 2014-08-23
      • 1970-01-01
      • 2011-02-12
      • 2016-02-24
      相关资源
      最近更新 更多