Winetricks not finding wine after selecting a game
Describe the bug After trying to select a game on the GUI, I recieve a winetricks error box displaying "WINE is /usr/bin/wine, which is neither on the path nor an executable file"
To Reproduce Steps to reproduce the behavior:
- Run
protontricks --gui - Select a game
- Above winetricks error is displayed.
Expected behavior The winetricks menu should open.
System (please complete the following information):
- Distro: Ubuntu 24.04.1
- Protontricks installation method: Flatpak
- Protontricks version: 1.11.1
- Steam version: steam_beta
If you run env | grep WINE in your terminal, does it print anything?
I'm guessing you have set WINE somewhere (e.g. ~/.bashrc, ~/.profile), which is being inherited by the Flatpak process. The problem is that /usr/bin/wine does not exist inside the Flatpak sandbox and Protontricks/Winetricks can't find it.
I get this
~$ env | grep WINE
WINE=/usr/bin/wine
WINETRICKS=/usr/bin/winetricks
So it does seem it's just out of reach for Flatpak. How can I change it to something it can access?
There's no need, unless you specifically need to run a specific version of Winetricks. The Protontricks Flatpak has a built-in Winetricks executable.
Otherwise, you could try installing Winetricks under your home directory somewhere. You might need to add a filesystem permission using Flatseal first, though.
Would you mind giving me a quick rundown on how to do this? I'm quite new to linux, and I'm not sure how to go about it.
We'll probably want to remove those environment variables completely unless you set them yourself. Maybe you used a Wine or Proton related utility that added those environment variables?
You could try running the following command to open a Bash shell; this should print a lot of detailed startup information about the environment, including any environment variables such as WINE and WINETRICKS and where they are set:
bash --verbose -x
Search for WINE or WINETRICKS other in the output. It should be preceded by a file path that determines what file set that environment variable. For example, in the following example PS1 was set inside /etc/bash.bashrc:
❯ bash --verbose -x
#
# /etc/bash.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
+ [[ himvxBH != *i* ]]
PS1='[\u@\h \W]\$ '
+ PS1='[\u@\h \W]\$ '
You can then open the file in a text editor and check for WINE=/usr/bin/wine or other similar lines you saw in the output. If you find any, could you report back where you found them? It would be useful to know what application is causing this, as this behavior can easily trip up Flatpak Protontricks installations and be a pain to diagnose, as I'm sure you've noticed. :)
Thanks for your reply! I ran the command, and found the variables here:
#Personal Wine and Winetricks envs for Protontricks
export WINE="/usr/bin/wine"
+ export WINE=/usr/bin/wine
+ WINE=/usr/bin/wine
export WINETRICKS="/usr/bin/winetricks"
+ export WINETRICKS=/usr/bin/winetricks
+ WINETRICKS=/usr/bin/winetricks
alias protontricks='flatpak run com.github.Matoking.protontricks'
+ alias 'protontricks=flatpak run com.github.Matoking.protontricks'
alias protontricks-launch='flatpak run --command=protontricks-launch com.github.Matoking.protontricks'
+ alias 'protontricks-launch=flatpak run --command=protontricks-launch com.github.Matoking.protontricks'
Thanks for your reply! I ran the command, and found the variables here:
#Personal Wine and Winetricks envs for Protontricks export WINE="/usr/bin/wine" + export WINE=/usr/bin/wine + WINE=/usr/bin/wine export WINETRICKS="/usr/bin/winetricks" + export WINETRICKS=/usr/bin/winetricks + WINETRICKS=/usr/bin/winetricks alias protontricks='flatpak run com.github.Matoking.protontricks' + alias 'protontricks=flatpak run com.github.Matoking.protontricks' alias protontricks-launch='flatpak run --command=protontricks-launch com.github.Matoking.protontricks' + alias 'protontricks-launch=flatpak run --command=protontricks-launch com.github.Matoking.protontricks'
OK, it looks like those environment variables were added by hand?
The solution here would be to remove the WINE and WINETRICKS variables. Protontricks should discover Winetricks automatically as necessary. WINE environment variable for Protontricks is usually counter-productive since different games can use different versions of Proton (aka Wine). Using the system Wine for them might cause issues.
This is weird, I unset the variables with unset, which allowed protontricks to work. However, when I tried to open it again, the original bug occurred again.
I checked, and WINE and WINETRICKS seem to have been set again. I unset them, and protontricks ran normally, would you know why that would happen, and how to make the change stick?
Maybe ~/.profile or ~/.bashrc whatever file that contains the declarations is being read again inside the Flatpak sandbox? I can reproduce this by setting something inside ~/.bashrc (eg. export FOO=1) and running FOO=2 flatpak run --command=bash com.github.Matoking.protontricks; the environment variable will reset to FOO=1 inside the sandbox.
Did you remove them entirely from the originating file, or did you use unset to temporarily remove them before running flatpak run?