Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sh: 0: Can't open winetricks #20

Open
eqjjh opened this issue Aug 21, 2020 · 8 comments
Open

sh: 0: Can't open winetricks #20

eqjjh opened this issue Aug 21, 2020 · 8 comments

Comments

@eqjjh
Copy link

eqjjh commented Aug 21, 2020

$ env WINEARCH=win32 sh winetricks arch=32 prefix=supermemo17
sh: 0: Can't open winetricks

$ uname -rom
5.4.0-42-generic x86_64 GNU/Linux

$ wine --version
wine-5.0 (Ubuntu 5.0-3ubuntu1)

$ winetricks --version
20200412 - sha256sum: 7651c93e39fcb080483c38836513bf912273a87ea97d137f6b958ed3d9628c3d

I see there is a closed issue with a similar error message but that user is using a different linux distribution so not sure if the solution is the same.

@alessivs
Copy link
Owner

alessivs commented Aug 21, 2020

Depending on the location of the winetricks script you may have to adapt the invocation so the shell finds it. Also, I believe winetricks fixed the bug that led me to recommend two invocations instead of one.

If you run which winetricks and it doesn't output an error message you can run:

env WINEARCH=win32 sh $(which winetricks) arch=32 prefix=supermemo17 supermemo17.verb

Else, just provide the path to winetricks.

  • If in the same directory:
env WINEARCH=win32 sh ./winetricks arch=32 prefix=supermemo17 supermemo17.verb
  • Other location, e.g.:
env WINEARCH=win32 sh /home/me/some/directory/winetricks arch=32 prefix=supermemo17 supermemo17.verb

@eqjjh
Copy link
Author

eqjjh commented Aug 21, 2020

$ which winetricks
/usr/bin/winetricks

$ env WINEARCH=win32 sh /usr/bin/winetricks arch=32 prefix=supermemo17
Executing mkdir -p /home/me
Using winetricks 20200412 - sha256sum: 7651c93e39fcb080483c38836513bf912273a87ea97d137f6b958ed3d9628c3d with wine-5.0 (Ubuntu 5.0-3ubuntu1) and WINEARCH=win32
Executing mkdir -p /home/me/.local/share/wineprefixes

$ sh /usr/bin/winetricks prefix=supermemo17 supermemo17.verb
Executing mkdir -p /home/me/.local/share/wineprefixes
Using winetricks 20200412 - sha256sum: 7651c93e39fcb080483c38836513bf912273a87ea97d137f6b958ed3d9628c3d with wine-5.0 (Ubuntu 5.0-3ubuntu1) and WINEARCH=win32
/usr/bin/winetricks: 7: ./supermemo17.verb: Syntax error: newline unexpected

It looks like supermemo17.verb was updated at some point because I when I redownloaded it now, I got a different hash, but the same error message when I ran the above command.

$ sha256sum supermemo17.verb
1537059b466dcda2630b91d232af6d59f9c65ef2a18f9d7ef771c65c941e0a7e supermemo17.verb

@alessivs
Copy link
Owner

/usr/bin/winetricks: 7: ./supermemo17.verb: Syntax error: newline unexpected

I need more time to investigate. There is no syntax error in the verb file unless sh is an unexpected non-POSIX interpreter in your system.

$ sha256sum supermemo17.verb

The sha256sum displayed by Winetricks is of the winetricks script itself, and it is helpful in identifying the version when troubleshooting.


Suggestion: bypass Winetricks's architecture-choosing method completely. Maybe there's some oddity when you have a 64-bit default prefix.

# clean up from previous tries
rm -rf ~/.local/share/wineprefixes/supermemo17 

env WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/supermemo17 sh /usr/bin/winetricks supermemo17.verb

@eqjjh
Copy link
Author

eqjjh commented Aug 21, 2020

Same error message:

$ rm -rf ~/.local/share/wineprefixes/supermemo17

$ env WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/supermemo17 sh /usr/bin/winetricks supermemo17.verb
Executing mkdir -p /home/me/.local/share/wineprefixes
Using winetricks 20200412 - sha256sum: 7651c93e39fcb080483c38836513bf912273a87ea97d137f6b958ed3d9628c3d with wine-5.0 (Ubuntu 5.0-3ubuntu1) and WINEARCH=win32
/usr/bin/winetricks: 7: ./supermemo17.verb: Syntax error: newline unexpected

I posted the sha256 hash of the supermemo.verb so you could confirm it is the same as the version you have, since I thought maybe the supermemo.verb was causing the error message.

@alessivs
Copy link
Owner

alessivs commented Aug 21, 2020

Thanks again.

OK. Let's see where it fails. Please follow along:

# clean up from previous tries
rm -rf ~/.local/share/wineprefixes/supermemo17

# remove your copy of the verb
rm supermemo17.verb

# grab the supermemo17.verb file byte-for-byte
wget https://raw.githubusercontent.com/alessivs/supermemo-wine/master/verbs/supermemo17.verb -O supermemo17.verb

# send me this output
echo $SHELL

# debug the failure spot: send me the lines above the error message for context
set -x
env WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/supermemo17 sh /usr/bin/winetricks supermemo17.verb

@eqjjh
Copy link
Author

eqjjh commented Aug 21, 2020

Just included the complete output. The formatting was strange when I didn't include it in the code brackets, so re-posting:

~$ rm -rf ~/.local/share/wineprefixes/supermemo17
~$ rm supermemo17.verb
~$ wget https://github.com/alessivs/supermemo-wine/blob/master/verbs/supermemo17.verb
--2020-08-21 12:50:48--  https://github.com/alessivs/supermemo-wine/blob/master/verbs/supermemo17.verb
Resolving github.com (github.com)... 140.82.114.4
Connecting to github.com (github.com)|140.82.114.4|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘supermemo17.verb’

supermemo17.verb        [  <=>               ] 138.37K   603KB/s    in 0.2s    

2020-08-21 12:50:49 (603 KB/s) - ‘supermemo17.verb’ saved [141687]

~$ echo $SHELL
/bin/bash
~$ set -x
~$ env WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/supermemo17 sh /usr/bin/winetricks supermemo17.verb
+ env WINEARCH=win32 WINEPREFIX=/home/me/.local/share/wineprefixes/supermemo17 sh /usr/bin/winetricks supermemo17.verb
Executing mkdir -p /home/me/.local/share/wineprefixes
Using winetricks 20200412 - sha256sum: 7651c93e39fcb080483c38836513bf912273a87ea97d137f6b958ed3d9628c3d with wine-5.0 (Ubuntu 5.0-3ubuntu1) and WINEARCH=win32
/usr/bin/winetricks: 7: ./supermemo17.verb: Syntax error: newline unexpected
~$ 

@biogogotop
Copy link

the problem is that wget command does not download the verb file but html file.

wget https://github.com/alessivs/supermemo-wine/blob/master/verbs/supermemo17.verb

try downloading the verb file by web browser
open https://github.com/alessivs/supermemo-wine/blob/master/verbs/supermemo17.verb
right click the Raw button and save link as...

env WINEARCH=win32 WINEPREFIX=/home/yourusername/.local/share/wineprefixes/supermemo17 sh /usr/bin/winetricks supermemo17.verb

@alessivs
Copy link
Owner

Thanks for the catch, @biogogotop. Instructions amended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants