Results 1 to 4 of 4

Thread: Problem creating symbolic link to executable

  1. #1
    Join Date
    Jul 2008
    Beans
    11

    Problem creating symbolic link to executable

    I have an executable in an obscure directory. I want to put a link to it in /usr/local/bin. So I make a link with "sudo ln -s". But then trying to run the program from the command line fails, despite /usr/lcoal/bin being in my $PATH list. The command "which" fails to find it as well.

    Going to /usr/local/bin and running ls -l, the links are there but are red colored outlined in grey. Googling, this apparently means they are links that are to "unstatable" files. I don't know what that means, though.

    Running the program works if I put in the pathname to the original, obscure directory that the actual executable sits in, so I'm pretty sure its not a problem with the actual program.

    What's going on?

  2. #2
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Problem creating symbolic link to executable

    Quote Originally Posted by emustrangler View Post
    I have an executable in an obscure directory. I want to put a link to it in /usr/local/bin. So I make a link with "sudo ln -s". But then trying to run the program from the command line fails, despite /usr/lcoal/bin being in my $PATH list. The command "which" fails to find it as well.

    Going to /usr/local/bin and running ls -l, the links are there but are red colored outlined in grey. Googling, this apparently means they are links that are to "unstatable" files. I don't know what that means, though.

    Running the program works if I put in the pathname to the original, obscure directory that the actual executable sits in, so I'm pretty sure its not a problem with the actual program.

    What's going on?
    Please post the output of
    Code:
    ls -l
    to show the file permissions of the executable itself as well as the link in /usr/local/bin

  3. #3
    Join Date
    Oct 2008
    Location
    Ottawa, Canada
    Beans
    809
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: Problem creating symbolic link to executable

    Did you make the link specifying full pathnames?
    Code:
    sudo ln -s /<full>/<path>/<to>/<file> /usr/local/bin
    If not the link will be relative (e.g ./<file>) and won't point to anything useful when placed in /usr/local/bin

    Cheers!
    husband@wife$ make sandwich
    Permission denied
    husband@wife$ sudo make sandwich

  4. #4
    Join Date
    Jul 2008
    Beans
    11

    Re: Problem creating symbolic link to executable

    Quote Originally Posted by LewisTM View Post
    Did you make the link specifying full pathnames?
    Code:
    sudo ln -s /<full>/<path>/<to>/<file> /usr/local/bin
    If not the link will be relative (e.g ./<file>) and won't point to anything useful when placed in /usr/local/bin

    Cheers!
    This was the problem. I didn't realize ln didn't understand relative pathnames for the targets. Thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •