Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-25-2008, 12:49 PM   #1
Registered: Feb 2004
Posts: 34

Rep: Reputation: 15
Cannot execute symbolic link on Debian

hi there,
I have strange problem (strange for me) with sym-links:

1. I have executable, I can execute it by (chmod is 777 for sure):

2. I create the sym-link
ln -sf ../usr/bin/ccache mylink

3. chmod 777 mylink (for sure)

4. ./mylink
error message comes up: "no such file or directory".

Please tell me what am I doing wrong?

Thnx in advance.

Old 06-25-2008, 01:07 PM   #2
Senior Member
Registered: May 2006
Distribution: Caldera, CTOS, Debian, FreeBSD, Mac OS X, Mandrake, Minix, OpenBSD, Slackware, SuSE
Posts: 1,757

Rep: Reputation: 80
I get the same error, but looking at ccache man page shows where/how to put the symbolic link. I followed those instructions and didn't see the error. I'm not sure if that's what you need to do.
Old 06-25-2008, 01:18 PM   #3
Registered: Feb 2004
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks for hint. I've tried but no effect. Still the same problem :-(.
Old 06-25-2008, 01:36 PM   #4
Registered: Apr 2002
Location: Clinton Township, MI
Distribution: Debian, antiX, Kubuntu, Xubuntu, and many others
Posts: 591
Blog Entries: 15

Rep: Reputation: 69
I noticed what appeared to be some extra .. in your spec

Originally Posted by cold View Post
Thanks for hint. I've tried but no effect. Still the same problem :-(.
In general, the symbolic link has the syntax:

ln -sf /FullPath-to-Real-Image Fake-link
Assuming the place you mention is correct, then the correct command would be something like:

(cd ~; ln -sf /usr/bin/ccache mylink)
This command:

1. Makes sure you are in your home directory, where you most certainly ought to be able to create a link and

2. Makes sure to use an absolute path name to the procedure.

A couple of other points:

1. Instead of using a compound command, you can also separate it into two distinct commands if you do not mind ending up in your home directory:

cd ~; ln -sf /usr/bin/ccache mylink
2. To ensure that /usr/bin/ccache is really a file and is accessible, try this:
file /usr/bin/ccache
That will tell you what kind of a file (executable, shell script, link, etc. this file appears on your system. If you believe that it could be a link, then
ls -l /usr/bin/ccache
will show you the location if there are links, then you can follow the potential cascade of links to either find a file pointed to by the links or a breakage of the links.

On my system, I in fact do not have such a file at all. Check yours to be sure what you are looking for is actually there and it is what you expect it to be.

Hope this helps you out.

Last edited by masinick; 06-25-2008 at 01:40 PM.
Old 06-26-2008, 05:12 AM   #5
Registered: Feb 2004
Posts: 34

Original Poster
Rep: Reputation: 15
hi there,
thanks for hints. The only problem is that I cannot execute the link. The target is executable, I can execute "../usr/bin/ccache" (rights are 777 for sure). I've tried to create a link with absolute and with relative path as well, the behavior is the same.
What is strange for me, I can edit the file that the link points to, e.g.

1. ln -sf ../usr/bin/ccache mylink
2. file mylink
-> ... symbolic link to ...
3. vim ./mylink (rights are also set to 777)
(not nice, I know :-)). But I can see the content of the binary file!
4. ./mylink
mylink: no such file or directory.

Is it possible that there's some problem with SELinux? Or some strange access right settings that dinosaur like me is not aware of? :-).
Thanks in advance.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create symbolic link to html file and avoid page link problem? haxpor Linux - General 2 01-29-2008 07:40 AM
help with a symbolic link mykrob Linux - Software 6 11-22-2004 10:01 AM
symbolic link jsetter Linux - Newbie 4 11-22-2004 07:18 AM
Symbolic link. bulzbb Linux - General 8 03-19-2004 04:57 AM
Symbolic link bwaynej2002 Linux - General 8 08-25-2003 10:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:24 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration