Home Explore Blog CI



nix

src/nix/profile-remove.md
ee8fc2ccb18a2c5a5df94a83f6635f2b30921395057623b600000003000001d9
R""(

# Examples

* Remove a package by name:

  ```console
  # nix profile remove hello
  ```

* Remove all packages:

  ```console
  # nix profile remove --all
  ```

* Remove packages by regular expression:

  ```console
  # nix profile remove --regex '.*vim.*'
  ```


* Remove a package by store path:

  ```console
  # nix profile remove /nix/store/rr3y0c6zyk7kjjl8y19s4lsrhn4aiq1z-hello-2.10
  ```

# Description

This command removes a package from a profile.

)""

Chunks
010fda9c (1st chunk of `src/nix/profile-remove.md`)
Title: Nix Profile Remove Command
Summary
The `nix profile remove` command is used to remove packages from a Nix profile, offering several methods to specify which packages to remove. Packages can be removed by name, using the package's identifier. Regular expressions can also be used to remove multiple packages matching a pattern in their names or descriptions, useful for removing related packages. Another method is removal by store path, the unique location of the package in the Nix store, providing precise identification. The command also supports removing all packages from the profile at once, effectively clearing it. The examples demonstrate syntax for each removal method, showing how to specify the package name, regular expression, or store path. This command is crucial for managing packages in a Nix profile and ensuring it contains only the desired software.