Running into an error during installation

I’m trying to install nix but keep running into this issue and can’t fix it even after following the instructions what do I do ?

(the error message in my terminal): I back up shell profile/rc scripts before I add Nix to them.
I need to back up /etc/bashrc to /etc/bashrc.backup-before-nix,
but the latter already exists.

Here’s how to clean up the old backup file:

  1. Back up (copy) /etc/bashrc and /etc/bashrc.backup-before-nix
    to another location, just in case.

  2. Ensure /etc/bashrc.backup-before-nix does not have anything
    Nix-related in it. If it does, something is probably quite
    wrong. Please open an issue or get in touch immediately.

  3. Once you confirm /etc/bashrc is backed up and
    /etc/bashrc.backup-before-nix doesn’t mention Nix, run:
    mv /etc/bashrc.backup-before-nix /etc/bashrc

We’d love to help if you need it.

You can open an issue at

Or get in touch with the community: Community | Nix & NixOS

Can you ls -al /etc | grep bashrc?

just tried this and nothing happened

… and you still get that error? Weird, that’d mean those files don’t exist.

Do you know any other way I could resolve the issue ?
I followed the instructions that were given to me in the terminal and immediately ran into the same issue when I tried to redownload

Which installation instructions are you following?

I used this link to install: sh <(curl -L https://nixos.org/nix/install) --daemon

The error occurs just after the “can I use Sudo y/n” part

Then these instructions come up to fix the issue but even after following each step the error doesn’t get resolved:

back up shell profile/rc scripts before I add Nix to them.
I need to back up /etc/bashrc to /etc/bashrc.backup-before-nix,
but the latter already exists.

Here’s how to clean up the old backup file:

  1. Back up (copy) /etc/bashrc and /etc/bashrc.backup-before-nix
    to another location, just in case.
  2. Ensure /etc/bashrc.backup-before-nix does not have anything
    Nix-related in it. If it does, something is probably quite
    wrong. Please open an issue or get in touch immediately.
  3. Once you confirm /etc/bashrc is backed up and
    /etc/bashrc.backup-before-nix doesn’t mention Nix, run:
    mv /etc/bashrc.backup-before-nix /etc/bashrc

Maybe try the detsys installer?

1 Like

Are you sure it isn’t the same message for a different file? IIRC the error is for the first file encountered, but the installer does create more than one shell profile.

I’d follow the steps the installer is listing for all of the backup-before-nix files, and step through the appropriate Uninstalling Nix - Nix Reference Manual steps for your platform for good measure.

Edit: If this doesn’t work, it may help to see a full console log of the clean-up/uninstall and reinstall process.

1 Like

That didn’t work either :frowning:

I uninstalled and ran the necessary commands to make sure everything was uninstalled correctly and it was but during reinstallation the same error occurred so I might have to just abort mission at this point

Can you follow those steps, and then report back on what ls -la /etc says?