HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

nix profile — Install, update, and remove packages from Nix profiles. More information: <https://nix.dev/manual/ni

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandremoveupdateandinstallclinix profilepackages

Problem

How to use the nix profile command: Install, update, and remove packages from Nix profiles. More information: <https://nix.dev/manual/nix/latest/command-ref/new-cli/nix3-profile.html>.

Solution

nix profile — Install, update, and remove packages from Nix profiles. More information: <https://nix.dev/manual/nix/latest/command-ref/new-cli/nix3-profile.html>.

Install packages from nixpkgs into the default profile:
nix profile add {{nixpkgs#pkg1 nixpkgs#pkg2 ...}}


Install a package from a flake on GitHub into a custom profile:
nix profile add {{github:owner/repo/pkg}} --profile {{path/to/directory}}


List packages currently installed in the default profile:
nix profile list


Remove a package installed from nixpkgs from the default profile, by name:
nix profile remove {{legacyPackages.x86_64-linux.pkg}}


Upgrade packages in the default profile to the latest available versions:
nix profile upgrade --all


Rollback (cancel) the latest action on the default profile:
nix profile rollback

Code Snippets

Install packages from nixpkgs into the default profile

nix profile add {{nixpkgs#pkg1 nixpkgs#pkg2 ...}}

Install a package from a flake on GitHub into a custom profile

nix profile add {{github:owner/repo/pkg}} --profile {{path/to/directory}}

List packages currently installed in the default profile

nix profile list

Remove a package installed from nixpkgs from the default profile, by name

nix profile remove {{legacyPackages.x86_64-linux.pkg}}

Upgrade packages in the default profile to the latest available versions

nix profile upgrade --all

Context

tldr-pages: common/nix profile

Revisions (0)

No revisions yet.