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

Big Sur 11.2 diskutil: command not found #4488

Closed
0ihsan opened this issue Jan 28, 2021 · 4 comments · Fixed by #4289
Closed

Big Sur 11.2 diskutil: command not found #4488

0ihsan opened this issue Jan 28, 2021 · 4 comments · Fixed by #4289
Labels
bug macos Nix on macOS, aka OS X, aka darwin

Comments

@0ihsan
Copy link

0ihsan commented Jan 28, 2021

Install script can't find diskutil because the diskutil not in $PATH

Steps To Reproduce

  1. Install macOS Big Sur 11.2
  2. Run the installation command:
curl -L https://nixos.org/nix/install | sh
  1. See error:
...unpack/nix-2.3.10-x86_64-darwin/install: line 115: diskutil: command not found
-:1: parser error : Document is empty

I think the solution is to call diskutil by its full path: /usr/sbin/diskutil.

@0ihsan 0ihsan added the bug label Jan 28, 2021
@domenkozar domenkozar added the macos Nix on macOS, aka OS X, aka darwin label Jan 29, 2021
abathur added a commit to abathur/nix that referenced this issue Jan 31, 2021
@abathur
Copy link
Member

abathur commented Jan 31, 2021

I'm a little skeptical about whether /usr/sbin has been intentionally removed from the default PATH, but nailing these paths down has already been on my mind.

In a naked attempt to get it pushed through the pipeline, I've added a commit to my existing PR #4289 that nails down instances of diskutil by absolute path.

I suspect there are other utilities in /usr/sbin/ used in the installer, so I'll probably go ahead and audit the rest of them later this evening.

@abathur
Copy link
Member

abathur commented Jan 31, 2021

I got 11.2 20D64 installed on a system overnight (had to fresh install 11.1 after the upgrade from 11.0 -> 11.1 broke, rejoin beta program, and upgrade to 11.2) and it looks like my stock PATH is /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin.

Unless maybe you did a direct no-upgrade fresh install of 11.2, it seems like something in your RC/profile files may be causing this?

In any case, I think it's still fine to nail these down.

@0ihsan
Copy link
Author

0ihsan commented Jan 31, 2021

  • I was using 11.1 and was able to run the utilities in the /usr/sbin/ so there were no problems.
  • Then I upgraded to 11.2 and deleted my /nix to get started from scratch (maybe I've messed up with my config files in this step?).
  • Finally issue happened. I checked the $PATH, it was /bin:/usr/bin (or /usr/bin:/bin I don't recall correctly).

I am sorry, I should have been written this in the issue description. I guess you are right about having my rc/profile files causing this.

abathur added a commit to abathur/nix that referenced this issue Feb 25, 2021
abathur added a commit to abathur/nix that referenced this issue Mar 11, 2021
abathur added a commit to abathur/nix that referenced this issue Mar 25, 2021
abathur added a commit to abathur/nix that referenced this issue Mar 25, 2021
abathur added a commit to abathur/nix that referenced this issue Mar 25, 2021
@bkase
Copy link

bkase commented May 3, 2021

I also experienced this issue, and for those looking for a workaround, I can confirm the following resolves the problem:

export PATH=/usr/sbin:$PATH
sh <(curl -L https://nixos.org/nix/install) --daemon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug macos Nix on macOS, aka OS X, aka darwin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants