← 返回命令列表

Linux command

nix-store 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Query package dependencies

nix-store -q --references [/nix/store/...path]

Query reverse dependencies

nix-store -q --referrers [/nix/store/...path]

Show dependency tree

nix-store -q --tree [/nix/store/...path]

Garbage collect

nix-store --gc

Optimize store

nix-store --optimise

Verify store integrity

nix-store --verify --check-contents

说明

nix-store manages the Nix store (/nix/store). It handles garbage collection, optimization, queries, and store maintenance operations. The Nix store contains all packages and their dependencies as immutable paths.

参数

-q, --query
Query mode.
--gc
Garbage collect.
--optimise
Deduplicate store.
--verify
Verify store integrity.
--references
Show dependencies.
--referrers
Show reverse dependencies.
--tree
Show dependency tree.
--delete
Delete paths.

FAQ

What is the nix-store command used for?

nix-store manages the Nix store (/nix/store). It handles garbage collection, optimization, queries, and store maintenance operations. The Nix store contains all packages and their dependencies as immutable paths.

How do I run a basic nix-store example?

Run `nix-store -q --references [/nix/store/...path]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -q, --query do in nix-store?

Query mode.