LinuxCommandLibrary

guix-package

Install, remove, and manage software packages

TLDR

Install a new package

$ guix package [[-i|--install]] [package]
copy

Remove a package
$ guix package [[-r|--remove]] [package]
copy

Search the package database for a regex
$ guix package [[-s|--search]] "[search_pattern]"
copy

List installed packages
$ guix package [[-I|--list-installed]]
copy

List generations
$ guix package [[-l|--list-generations]]
copy

Roll back to the previous generation
$ guix package --roll-back
copy

SYNOPSIS

guix package --install=PACKAGE... [OPTION...]
guix package --remove=PACKAGE... [OPTION...]
guix package --update [OPTION...]
guix package --upgrade [OPTION...]
guix package --search REGEX... [OPTION...]
guix package --manifest=FILE [OPTION...]
guix package --roll-back [OPTION...]
guix package --list-generations [OPTION...]
guix package --show=PACKAGE... [OPTION...]

PARAMETERS

--install=PACKAGE...
    Installs specified PACKAGEs into the current user profile. Can take multiple package specifications, e.g., 'bash@5.1'.

--remove=PACKAGE...
    Removes specified PACKAGEs from the current user profile, effectively reverting the profile to a state without them.

--update
    Updates the Guix channel definitions to their latest versions, fetching new package descriptions and build recipes.

--upgrade
    Upgrades all packages currently installed in the profile to their newest available versions based on the updated channels.

--search=REGEX...
    Searches for packages whose name or description matches the given regular expression, displaying relevant results.

--manifest=FILE
    Installs or updates packages specified in a declarative Guile Scheme manifest FILE, ensuring the profile's contents match its declaration.

--profile=PROFILE
    Specifies the user profile to operate on. If not given, the default `~/.guix-profile` is used for non-root operations.

--roll-back
    Reverts the current profile to its immediately preceding transactional generation, effectively undoing the last change.

--list-generations
    Lists all past generations of the current profile, showing their timestamps, associated operations, and disk usage.

--show=PACKAGE...
    Displays detailed information about the specified PACKAGEs, including their dependencies, build inputs, and available versions.

--dry-run
    Shows a preview of the operations that would be performed without actually modifying the profile or system, useful for verification.

DESCRIPTION

guix package is the primary command-line tool for users to interact with the GNU Guix package manager to manage software packages. It facilitates declarative installation, removal, upgrade, and querying of packages in a reproducible and transactional manner.

Unlike traditional package managers, guix package ensures that installations are purely functional, meaning dependencies are precisely specified and isolated, leading to reliable and rollback-able system configurations. It can manage packages for the current user's profile or for the entire system when run with root privileges. This command is central to leveraging Guix's unique features like transactional upgrades, declarative system configuration, and isolated software environments.

CAVEATS

  • Requires root privileges for system-wide operations or manipulating system profiles (e.g., `/var/guix/profiles/system`).
  • Relies on Guix channels being up-to-date (`guix pull` and `guix package --update`) for accurate package information and successful builds.
  • Disk space consumption can be high due to storing all generations of profiles and immutable store paths for packages.
  • Network access is essential for fetching new packages, channel updates, and their cryptographic signatures.
  • Familiarity with Guile Scheme is beneficial for advanced usage, especially when defining custom packages or manifest files.

PROFILES AND GENERATIONS

Unlike traditional package managers, guix package operates on user-specific "profiles" (symbolic links to immutable store paths) and maintains "generations" (historical snapshots of a profile). This allows for transactional upgrades, easy rollbacks to previous states, and multiple independent user environments without conflicts. Each operation typically creates a new generation, preserving the old one for easy reversion.

MANIFESTS

A manifest is a Guile Scheme file that declaratively specifies a set of packages and their exact versions that a user wants installed in a profile. Using guix package --manifest=FILE allows for highly reproducible and shareable package configurations, ensuring that a specific environment can be recreated identically on different machines or at a later time.

HISTORY

guix package is a core component of GNU Guix, which itself originated in 2012 as a project aiming to bring the Nix package manager's purely functional approach to the GNU system, using Guile Scheme for its definitions. The guix package command has been central from early on, providing the primary user-facing interface for managing software in a transactional, reproducible, and declarative way, aligning with Guix's core principles. Its development has mirrored the evolution of Guix, incorporating features like profile management, manifest support, and advanced querying capabilities, continuously improving the user experience while adhering to its functional programming paradigm.

SEE ALSO

guix(1), guix pull(1), guix system(1), guix build(1), guix shell(1), guix gc(1)

Copied to clipboard