gpt4 book ai didi

python - 试图从/nix/store 中删除一个包,现在系统出现错误,如何修复?

转载 作者:行者123 更新时间:2023-12-04 08:24:07 26 4
gpt4 key购买 nike

error: opening file '/nix/store/4h464mkqfipf04jgz4jp3bx56sdn6av0-python3.7-somepackage-1.0.0.drv': No such file or directory
我手动删除了一些文件以尝试删除包。但是 nix-shell 不再起作用并给我上面的消息。我如何解决 nix 中的问题?我想完全删除软件包并重新安装它。
此外,当我运行以下命令时:
~/sources/integration_test >>> nix-env -u python3.7-somepackagesomepackage-1.0.0
error: selector 'python3.7-somepackages-1.0.0' matches no derivations

最佳答案

尝试运行

 nix-store --verify --check-contents --repair
从联机帮助页:
OPERATION --VERIFY
Synopsis
nix-store --verify [--check-contents] [--repair]

Description
The operation --verify verifies the internal consistency of the Nix database, and the
consistency between the Nix database and the Nix store. Any inconsistencies
encountered are automatically repaired. Inconsistencies are generally the result of
the Nix store or database being modified by non-Nix tools, or of bugs in Nix itself.

This operation has the following options:

--check-contents
Checks that the contents of every valid store path has not been altered by
computing a SHA-256 hash of the contents and comparing it with the hash stored in
the Nix database at build time. Paths that have been modified are printed out.
For large stores, --check-contents is obviously quite slow.

--repair
If any valid path is missing from the store, or (if --check-contents is given)
the contents of a valid path has been modified, then try to repair the path by
redownloading it. See nix-store --repair-path for details.

注意。 我建议您自己阅读手册页 man nix-store在运行之前确保这是你想要的。
NB.2 由于操作的性质,需要检查很多东西——这个操作需要一段时间。对于我的 11 GiB /nix/store ,这运行了 4 分 13 秒。

附录。 将来,当您想手动从 nix 存储中删除包时,请使用
nix-store --delete /nix/store/[what you want to delete]
反而。

关于python - 试图从/nix/store 中删除一个包,现在系统出现错误,如何修复?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65353725/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com