试图从/nix/store中删除包,但系统出现错误,如何修复?

2024-09-28 18:47:50 发布

您现在位置:Python中文网/ 问答频道 /正文

error: opening file '/nix/store/4h464mkqfipf04jgz4jp3bx56sdn6av0-python3.7-somepackage-1.0.0.drv': No such file or directory

我手动删除了一些文件,试图删除包。然而,nixshell不再工作,它给了我上面的信息。如何解决nix中的问题?我想完全删除该软件包并重新安装

此外,当我运行以下命令时:

~/sources/integration_test >>> nix-env -u python3.7-somepackagesomepackage-1.0.0
error: selector 'python3.7-somepackages-1.0.0' matches no derivations

Tags: or文件storeno信息nixerror手动
1条回答
网友
1楼 · 发布于 2024-09-28 18:47:50

试着跑步

 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.

NB.我建议您在运行本程序之前,自己用man nix-store阅读手册页,以确保这是您想要的

NB.2由于操作的性质,必须检查大量物品——此操作需要一段时间。对于我的11gib/nix/store,这运行了4m13s


附录。将来,当您想手动从nix存储中删除包时,请使用

nix-store  delete /nix/store/[what you want to delete]

相反

相关问题 更多 >