Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix profile install: packages have the same priority (when trying to re-install) #6143

Closed
nmattia opened this issue Feb 22, 2022 · 4 comments · Fixed by #6522
Closed

nix profile install: packages have the same priority (when trying to re-install) #6143

nmattia opened this issue Feb 22, 2022 · 4 comments · Fixed by #6522
Labels

Comments

@nmattia
Copy link
Contributor

nmattia commented Feb 22, 2022

Describe the bug

Looks like there is no way to re-install a package with the nix profile install command. It fails with the following error:

$ nix profile install
error: packages '/nix/store/d0wb2gam2pyksz2dsjx6sa83761jrrgi-hello-2.12/bin/hello' and '/nix/store/61n15131n3b9mn7ajvddbyfnv2b3pgjd-hello-2.12/bin/hello' have the same priority 5
; use 'nix-env --set-flag priority NUMBER INSTALLED_PKGNAME' to change the priority of one of the conflicting packages (0 being the highest priority)

I'm not sure how nix-env dealt with this.

(note: the 'nix-env' command suggested in the error message doesn't work because it complains that the profile was installed with "nix profile"; also this wouldn't really solve the issue)

Steps To Reproduce

$ nix flake init
$ nix profile install
# now edit `flake.nix` to change the "hello" derivation, for instance:
$ cat flake.nix
... hello.overrideAttrs (_: {
      postBuild = "echo hello";

    });
$ $ nix profile install
error: packages '/nix/store/d0wb2gam2pyksz2dsjx6sa83761jrrgi-hello-2.12/bin/hello' and '/nix/store/61n15131n3b9mn7ajvddbyfnv2b3pgjd-hello-2.12/bin/hello' have the same priority 5
; use 'nix-env --set-flag priority NUMBER INSTALLED_PKGNAME' to change the priority of one of the conflicting packages (0 being the highest priority)

Expected behavior

The hello package should be replaced.

A clear and concise description of what you expected to happen.

nix-env --version output

$ nix-env --version
nix-env (Nix) 2.6.0

Additional context

Running nix profile upgrade doesn't do anything. For now the workaround is to nix profile remove everything before nix profile installing.


EDIT: I just realized that nix profile upgrade can take a number. When giving it the same number of the flake used to install hello, I get the same error as nix profile install:

$ nix profile list | grep hello
6 path:/private/var/folders/tx/d4435y0s3dqbytdf1f09s8740000gn/T/tmp.YFCSpO8v#defaultPackage.aarch64-darwin path:/private/var/folders/tx/d4435y0s3dqbytdf1f09s8740000gn/T/tmp.YFCSp
O8v?narHash=sha256-JyMfoXbdBn9JlHIPJOPupn0K0zSuniX7bSFf1XQKY5I=#defaultPackage.aarch64-darwin /nix/store/61n15131n3b9mn7ajvddbyfnv2b3pgjd-hello-2.12
$ nix profile upgrade 6
error: packages '/nix/store/d0wb2gam2pyksz2dsjx6sa83761jrrgi-hello-2.12/bin/hello' and '/nix/store/61n15131n3b9mn7ajvddbyfnv2b3pgjd-hello-2.12/bin/hello' have the same priority 5
; use 'nix-env --set-flag priority NUMBER INSTALLED_PKGNAME' to change the priority of one of the conflicting packages (0 being the highest priority)
@nmattia nmattia added the bug label Feb 22, 2022
@blaggacao
Copy link
Contributor

blaggacao commented Feb 23, 2022

I suspect: (at least touching the same topic-circle)

// FIXME: priority

@jrpear
Copy link

jrpear commented Mar 17, 2022

I have this same issue when trying to install wine and wine64 with the file .../bin/function_grep.pl using nix profile install.

@AndersonTorres
Copy link
Member

Bump :/

@elikoga
Copy link
Contributor

elikoga commented May 9, 2022

bumping for self reference, might try at implementing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants