Home Explore Blog Models CI



nix

1st chunk of `src/nix/store-delete.md`
34d6b6326b54d0017b028f3669baf879b11ba180a398d85400000001000002d4
R""(

# Examples

* Delete a specific store path:

  ```console
  # nix store delete /nix/store/yb5q57zxv6hgqql42d5r8b5k5mcq6kay-hello-2.10
  ```

# Description

This command deletes the store paths specified by [*installables*](./nix.md#installables),
but only if it is safe to do so; that is, when the path is not
reachable from a root of the garbage collector. This means that you
can only delete paths that would also be deleted by `nix store
gc`. Thus, `nix store delete` is a more targeted version of `nix store
gc`.

With the option `--ignore-liveness`, reachability from the roots is
ignored. However, the path still won't be deleted if there are other
paths in the store that refer to it (i.e., depend on it).

)""

Title: `nix store delete` Command
Summary
The `nix store delete` command is used to remove specific store paths, acting as a more targeted version of `nix store gc`. It safely deletes paths only if they are not reachable from a garbage collector root. The `--ignore-liveness` option allows bypassing the reachability check, but paths will still not be deleted if other store paths depend on them. An example demonstrates how to use the command to delete a specific store path.