3

I need a quick help. I am a beginner so I think my problem is an easy one: Here it goes: I need to install a software application called muscle, and these are the steps from its website:

wget http://www.drive5.com/muscle/downloads3.8.31/muscle3.8.31_i86linux64.tar.gz
tar xzvf muscle3.8.31_i86linux64.tar.gz
mv muscle3.8.31_i86linux64 /usr/local/bin/muscle
chmod a+x /usr/local/bin/muscle

But it is permission denied to /usr/local/bin/. So, I created a directory called /home/users/me/muscle instead of /usr/local/bin/ and continued the steps. Finally, I added the directory to the path.

It did not work. Note: sudo command asks for a password which I do not have.

4
  • "Whenever I run my code-script which uses muscle" Please edit and add your code script to the question.
    – DavidPostill
    Jan 27, 2018 at 17:00
  • By design, only root can write to system folders, users have access to their userspaces only. In Debian and derivatives sudo is used to temporarily gain elevated privileges.
    – user772515
    Jan 27, 2018 at 17:11
  • sudo command asks for a password which I do not have
    – 104078
    Jan 27, 2018 at 17:13
  • @104078 “it did not work” is not a sufficient problem description. If my answer doesn't solve your problem, please show more details: what exact steps did you take? What errors did you get? How did you set up your $PATH?
    – slhck
    Jan 27, 2018 at 17:43

2 Answers 2

7

If you cannot get sudo rights with your user, you cannot write to /usr/local/bin. However, that might not even be necessary, as you can also install programs somewhere else, and amend your $PATH environment variable, which tells your shell where it can find executable programs.

So, I created a directory called /home/users/me/muscle instead of /usr/local/bin/ and continued the steps. Finally, I added the directory to the path. It did not work.

The recommended place to put your own user binaries would be ~/bin, that is /home/<username>/bin.

So copy the file to ~/bin/muscle (create the folder if it does not exist):

mkdir -p ~/bin
mv muscle3.8.31_i86linux64 ~/bin/muscle
chmod +x ~/bin/muscle

Save the file. Now, you need to make sure that your $PATH contains that bin directory.

If there is a file called ~/.bash_profile, edit it, or if it does not exist, simply create it, and add the following:

PATH="$HOME/bin:$PATH"

Now, you need to have your shell reload the paths where it can find binaries. There are several ways to do that, but the easiest is to log out and back in.

When you now echo $PATH, it should contain that bin directory. And when you run muscle, it should find that, because it's in the $PATH.

1

Does your account have a password?  If sudo is asking you for a password, it’s asking for your password.  Enter that and see whether you get permission.

Not the answer you're looking for? Browse other questions tagged .