简体   繁体   English

为什么需要sudo在Linux上使用leiningen(安装在/ bin中)?

[英]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,然后按照说明进行操作:

  1. download the script 下载脚本
  2. Paste the script(via command line) to ~/bin (PATH) 将脚本(通过命令行)粘贴到〜/ bin(PATH)
  3. Execute the script 执行脚本
  4. Run lein(I had to did it with sudo) to self-install 运行lein(我必须使用sudo来完成)以自行安装

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.

相关问题 Docker:为什么我需要在 Linux 中使用 sudo? - Docker: why do I need to sudo in Linux? 使用`chroot`:为什么运行`sudo chroot / bin / bash`会出错? - Using `chroot`: Why do I get error from running `sudo chroot /bin /bash`? Linux:使用sudo在bin中运行脚本 - Linux: Run script in bin with sudo 我在/ usr / local / bin中安装了gcc,为什么linux找不到它 - I have gcc installed in /usr/local/bin why linux can't find it su和sudo未安装,但我需要root权限才能安装它们 - su and sudo not installed, but I need root permission to install them 我需要在 Unix 上安装哪些工具才能让 C 程序访问安装在 Linux 上的 Informix 数据库? - What tools do I need installed on Unix to let C programs access an Informix database installed on Linux? 为什么我需要安装Java才能安装JavaEE6 SDK? - Why do I need Java installed to install the JavaEE6 SDK? 为什么我们在 Linux 命令中使用 -i? - Why do we use -i in Linux commands? 如何在阻止sudo的Linux发行版上安装RoR? - how do I install RoR on Linux distros that block sudo? 为什么每次关机/休眠后都需要再次执行 sudo chmod a+rw /dev/ttyACM0 命令? - Why do i need to execute sudo chmod a+rw /dev/ttyACM0 command again after every shutdown/hibernation?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM