[英]Why do I need to sudo to use leiningen (installed in /bin) on Linux?
I installed leiningen on fedora, I followed the instruction: 我在fedora上安装了leiningen,然后按照说明进行操作:
but every time I want to run the "lein" command, I have to do it with "sudo". 但是每次我想运行“ lein”命令时,都必须使用“ sudo”来执行。
How can i fix this? 我怎样才能解决这个问题? or what can i do to fix this? 或者我该怎么解决?
Note: I installed leiningen at /bin but when i cd ~/bin as the installation guide said i get and error about the folder(not exist). 注意:我在/ bin上安装了leiningen,但是当我cd〜/ bin作为安装指南时,我说到了关于该文件夹的错误(不存在)。
You installed it in /bin
and ran it with sudo to install the lein jars initially, which means they are owned (and probably only readable) by root. 您将其安装在/bin
,并使用sudo运行它,以首先安装lein罐,这意味着它们由root拥有(并且可能是唯一可读的)。 You should install the script at ~/bin
instead. 您应该将脚本安装在~/bin
。 You can fix it like this: 您可以这样解决:
sudo rm /bin/lein
sudo rm ~/.lein
mkdir ~/bin
cd ~/bin
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
export PATH="${HOME}/bin:${PATH}"
lein
You should also add ${HOME}/bin
to your $PATH
. 您还应该将${HOME}/bin
添加到$PATH
。 If you are using bash, add this to ~/.bashrc
: 如果您正在使用bash,请将其添加到~/.bashrc
:
export PATH="${HOME}/bin:${PATH}"
You can do that using echo
: 您可以使用echo
:
echo 'export PATH="${HOME}/bin:${PATH}"' >> ~/.bashrc
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.