1

I have Ubuntu installed on one partition of my computer and I'm trying to install Arch Linux on a second partition. I'm having trouble with the bootable USB, so I'm trying to just install it after booting Ubuntu and I add the binary path to $PATH and the pacstrap command I need shows up when I use the which command, but it doesn't work when I try to run it. I would just use ./pacstrap, but the it needs to be able to find other binaries that are in the same directory.

Is there a reason that the environment would be able to find a binary with 'which' but not when I execute it?

john@TheBrain:/storage/part4/Software/root.x86_64/bin$ export PATH
john@TheBrain:/storage/part4/Software/root.x86_64/bin$ sudo pacstrap /mnt base base-devel
sudo: pacstrap: command not found
john@TheBrain:/storage/part4/Software/root.x86_64/bin$ which pacstrap
/storage/part4/Software/root.x86_64/bin/pacstrap
john@TheBrain:/storage/part4/Software/root.x86_64/bin$ 

1 Answers1

5

It's because you're using sudo, which resets your environment to use its own secure path. You can tell it to use your normal path like this:

sudo env PATH=$PATH pacstrap
Zanna
  • 70,465