Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Problem with execute by symbolic link

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
JimSturgess
Posts: 4
Joined: 2017-12-05 14:11

Problem with execute by symbolic link

#1 Post by JimSturgess »

I would like execute file by symbolic link.

Destination file: /usr/bin/wine-development

So, I call:

ln -sf /usr/bin/wine-development /usr/local/bin/wine

When I run: wine-development --version it works, but when I call wine --version I get an error message:

error: unable to find wine executable. this shouldn't happen.

why the link does not work ?

(this problem appears only with wine, for any other files link is properly)

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Problem with execute by symbolic link

#2 Post by Segfault »

You forgot to tell us whether /usr/local/bin is in your $PATH.

JimSturgess
Posts: 4
Joined: 2017-12-05 14:11

Re: Problem with execute by symbolic link

#3 Post by JimSturgess »

Segfault wrote:You forgot to tell us whether /usr/local/bin is in your $PATH.
Unfortunately, this can not be the cause of the problem, because problem occurs even if the link is in the same directory.

moreover problem occurs only with wine , for any other file link work


for examle, I wrote:

ln -sf /usr/bin/bitmap /usr/local/bin/bitmap-tmp

and it works, I can execute file by "bitmap" and "bitmap-tmp"

but it doesnt work for link to "wine-development"

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Problem with execute by symbolic link

#4 Post by bw123 »

the 'which' command is sometimes helpful in situations like this
problem occurs even if the link is in the same directory
$PATH will take precedence unless you use ./whateverthelinknameis to run from the pwd

I don't use wine, but did it work before you installed wine-development? if you are following a web guide, maybe share the link and someone else can find the error.
resigned by AI ChatGPT

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Problem with execute by symbolic link

#5 Post by Segfault »

$PATH will not exactly take precedence. Your wording is kind of unlucky. Actually in POSIX systems the executables in current directory won't be found at all, unless you specify with "./". This is considered a security measure, makes harder to execute malicious binaries instead of legit ones.

JimSturgess
Posts: 4
Joined: 2017-12-05 14:11

Re: Problem with execute by symbolic link

#6 Post by JimSturgess »

bw123 wrote:the 'which' command is sometimes helpful in situations like this
$PATH is correct.

when I call "which wine", I receive

/usr/local/bin/wine

When I call "ls -la" in /usr/local/bin I receive:

lrwxrwxrwx 1 root staff 25 dec 5 21:56 wine -> /usr/bin/wine-development

in spite of all, "wine-development" works but "win" doesnt.

I do not know where the problem is

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Problem with execute by symbolic link

#7 Post by debiman »

maybe /usr/bin/wine-development is just another wrapper script.

Code: Select all

cat /usr/bin/wine-development

pendrachken
Posts: 1394
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: Problem with execute by symbolic link

#8 Post by pendrachken »

Not a big wine user anymore but a few things to check:

Is wine-development a binary file, script, or symlink itself?

If it is a script, does it have a proper shebang? is it trying to launch a subshell? - the whole "file: wine not found" hints at the possibility that it is a launcher script. If it is a script try inling directly to the wine binary in the path that the script uses.

If it is a symlink itself can you try linking to the binary it links to. Nesting symlinks can be messy and it is best to limit symlink nests.
fortune -o
Your love life will be... interesting.
:twisted: How did it know?

The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches :-P

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Problem with execute by symbolic link

#9 Post by debiman »

this is a doublepost, i think it was also on LQ.
it was solved there: the wrapper script tries to launch something else with the name it was called with ($0, i.e. "wine" instead of "wine-development"), which results in the file not found error.

PS:
oh, hello pendrachken, long time no see! :mrgreen:

Post Reply