Skip to content

I accidentally tried to install twice, it broke and I literally can't #32

Open
@irlydontcodelmao

Description

@irlydontcodelmao

---- warning! ------------------------------------------------------------------
Nix already appears to be installed. This installer may run into issues.
If an error occurs, try manually uninstalling, then rerunning this script.

Uninstalling nix:

  1. Remove macOS-specific components:

    • Uninstall LaunchDaemon org.nixos.nix-daemon

      sudo launchctl bootout system/org.nixos.nix-daemon
      sudo rm /Library/LaunchDaemons/org.nixos.nix-daemon.plist

  2. Restore /etc/bashrc.backup-before-nix back to /etc/bashrc

sudo mv /etc/bashrc.backup-before-nix /etc/bashrc

(after this one, you may need to re-open any terminals that were
opened while it existed.)

  1. Restore /etc/zshrc.backup-before-nix back to /etc/zshrc

sudo mv /etc/zshrc.backup-before-nix /etc/zshrc

(after this one, you may need to re-open any terminals that were
opened while it existed.)

  1. Delete the files Nix added to your system:

sudo rm -rf "/etc/nix" "/nix" "/var/root/.nix-profile" "/var/root/.nix-defexpr" "/var/root/.nix-channels" "/var/root/.local/state/nix" "/var/root/.cache/nix" "/Users/dany/.nix-profile" "/Users/dany/.nix-defexpr" "/Users/dany/.nix-channels" "/Users/dany/.local/state/nix" "/Users/dany/.cache/nix"

and that is it.

---- oh no! --------------------------------------------------------------------
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
https://github.com/NixOS/nix/issues/new?labels=installer&template=installer.md

Or get in touch with the community: https://nixos.org/community

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions