The command export PATH=$PATH/root/.bun/bin/bun
adds /root/.bun/bin/bun
to the PATH environment variable.
The $PATH variable in the command represents the current value of the PATH environment variable. By appending /root/.bun/bin/bun
to $PATH, you are adding this directory to the list of directories that the shell searches when you type a command.
tory.
Note that this command assumes that the bun executable file is located in the /root/.bun/bin
directory. If it is located in a different directory, you should modify the command accordingly.
If you have problem running bun in scripts. Check here.
/root/.bun/bin/bun
copy bun from there to this path. Or the path bun.service first check where bun is:
/usr/local/sbin
give permission to bun where it's first checked by the scripts. Be careful! Not the linux shell, but inside of scripts.
sudo chmod +x bun
to make ubuntu sudo environment variables available:
To make sudo bun
available in Ubuntu, follow these steps:
Open a terminal on your Ubuntu system.
Use the sudo visudo
command to edit the sudoers file:
sudo visudo
- Find the line that sets the
secure_path
. It will look something like this:
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
- Add the path to the
bun
executable (which is $HOME/.bun/bin
) to the secure_path
. You can use the $(echo $HOME)
command to get your home directory dynamically:
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:$(echo $HOME)/.bun/bin"
Save and exit the editor. In visudo
, this is typically done by pressing Esc
followed by :wq
and pressing Enter.
After saving the changes to the sudoers file, the sudo bun
command should now be available.
Remember to be careful while editing the sudoers file, as any syntax errors can cause problems with your system. Always use visudo
to edit the sudoers file to prevent such issues.