When installing gcc, I try to set the priority, but get the following result:
I searched for examples found a couple, but they seem similar. Is there something I’m doing wrong?
$ nix-env --version
nix-env (Nix) 2.11.1
Related Reading:
Hi guys!!!
I’m trying to migrate to NixOs and for that I set up an environment in VirtualBox. I would like to ask some questions.
Currently I use KDENeon and work with JetBrains Rider in C# in projects that need dotnet-sdk-2.2.401 and dotnet-sdk-5.0.401 I made the configuration in KdeNeon and try this result with dotNet --info
[image]
So the company project compiles normally. I am trying to set up this kind of environment in NixOs
My attempts so far have been
$ nix-env --preserve-installe…
Hi,
I am on a debian jessie system and have installed nix via https://nixos.org/nix/install which used: https://nixos.org/releases/nix/nix-2.3/nix-2.3-$system.tar.xz .
After the following command the error appears:
$ nix-env -i glibc-2.27 attr-2.4.48 acl-2.2.53 zlib-1.2.11 pcre-8.43 util-linux-2.33.2 libselinux-2.9 glib-2.60.7 libelf-0.8.13 linux-headers-4.19.16 glibc-iconv-2.27 bzip2-1.0.6.0.1 gdbm-1.18.1 sqlite-3.28.0 ncurses-6.1-20190112 bash-4.4-p23 expat-2.2.7 openssl-1.1.1c xz-5.2.4 rea…
From the error it seems as if you are trying to install direnv through home-manager, while it is already installed throgh nix-env. Remove the nix-env installed one, then re-reun HM.
NobbZ
March 24, 2023, 7:07pm
2
What is already installed via nix-env
?
Please use nix-env -q
to check.
As the message clearly says, that you shall set the priority of the already installed package.
Despite this questions, why are you trying to install gcc at all via nix-env
, especially as there seems to be already a gcc available on the system.
Why don’t use the gcc you already have?
It says “of one of the conflicting packages” and lists the not-installed one as conflicting. So I’d have to disagree. If it did say “set the priority of the already installed package” I would’ve known what to do.
Because I want a different version
Answer
$ nix-env -iA nixpkgs.THING1
Blah blah priority of `/nix/store/blahblahblah-thing1-0.0.1`
conflicts with `/nix/store/blahblahblah-thing2-2.2.2`
$ nix-env --set-flag priority 9 thing2-2.2.2
$ nix-env -iA nixpkgs.THING1
$ nix-env --set-flag priority 0 thing1-0.0.1
$ nix-env --set-flag priority 10 thing2-2.2.2
It seems rather round-about but I don’t see another way
NobbZ
March 27, 2023, 5:33pm
4
It says nix-env --set-flag priority NUMBER
INSTALLED_PKGNAME
…
Then use a nix-shell
for the project that requires the different version.