guix package is a command-line tool used to manage packages in the Guix System, which is a distribution of the GNU operating system that uses the GNU Guix package manager. guix package provides a variety of subcommands that you can use to install, upgrade, remove, and manage packages on your system.
The basic usage of guix package is guix package [subcommand] [options], where subcommand is the action you want to perform (e.g. install, upgrade, remove) and options are any additional options you want to pass to the subcommand.
Some of the most commonly used guix package subcommands are:
- guix package -i [package-name]: Install a package. For example, guix package -i emacs installs the emacs package.
- guix package -r [package-name]: Remove a package. For example, guix package -r emacs removes the emacs package.
- guix package -s [package-name]: Show information about a package, including its version, description, and dependencies.
- guix package -l [package-name]: Display the list of generations of a package, and rollback to a specific generation
One of the key benefits of using guix package is its ability to rollback to previous configurations. It uses a transactional approach to package management, which means that it keeps track of all the changes made to the system and allows you to rollback to a previous configuration if something goes wrong. This is done by keeping a list of generations of a package, you can use guix package -l [package-name] to display the list and rollback to a specific generation with guix package -r [package-name]@[generation-number]