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 recommends to remove the wrong installation name #8728

Closed
domenkozar opened this issue Jul 22, 2023 · 2 comments · Fixed by #10060
Closed

Nix recommends to remove the wrong installation name #8728

domenkozar opened this issue Jul 22, 2023 · 2 comments · Fixed by #10060
Labels

Comments

@domenkozar
Copy link
Member

This happens when you install a pacakge like nix profile install .

error: An existing package already provides the following file:

         /nix/store/dqj5nn2hlaxhd603c2j4hvych184pv4h-python3.10-devenv-1.0/lib/python3.10/site-packages/examples/simple/devenv.nix

       This is the conflicting file from the new package:

         /nix/store/j1izdcn09lw3kkcn68w7hjggjdk8krb4-python3.10-devenv-1.0/lib/python3.10/site-packages/examples/simple/devenv.nix

       To remove the existing package:

         nix profile remove git+file:///home/domen/dev/cachix/devenv#packages.x86_64-linux.default

       The new package can also be installed next to the existing one by assigning a different priority.
       The conflicting packages have a priority of 5.
       To prioritise the new package:

         nix profile install git+file:///home/domen/dev/cachix/devenv#packages.x86_64-linux.default --priority 4

       To prioritise the existing package:

         nix profile install git+file:///home/domen/dev/cachix/devenv#packages.x86_64-linux.default --priority 6

It should instead offer to remove the store path. cc @bobvanderlinden

@domenkozar domenkozar added the bug label Jul 22, 2023
@iFreilicht
Copy link
Contributor

Wouldn't removing the store path always fail as that is still referenced by a GC root from the previous profile generation?
What does you nix profile list actually look like in this case?

@bobvanderlinden
Copy link
Member

It should instead offer to remove the store path

It would be very inconvenient to suggest the store path in the most used cases, but it should indeed suggest something that works.

The best way imo to resolve this is to implement something like #7967. A first implementation was already made: #8678

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.

3 participants