First off I would like to say, I'm still relatively new to linux. Having been a long time windows user I'm used to being baby sat through things I want to do haha. Anyway on to my question.

I currently run wine to play a lot of my favourite games, so far I've been lucky and not run into any issues at all. I have a few niggles but nothing I can't fix myself except for this one. I want to play Grand Theft Auto San Andreas. The game runs beautifully with the exception of a sound problem. I went to the wine hq page and read through some solutions to the same problem that a lot of people seem to be having. The bug is here:


Someone wrote a custom patch to fix this issue. I asked someone how I would go about installing the custom patch that would fix this problem, and I was linked to a page with instructions that just made my head spin!

I really can't make sense of a lot of it. Because as I stated, I'm still quite new to linux. I'm getting better with linux but there's still a lot I need to learn. If anyone would be willing to either point me to some more simplified instructions on how to accomplish this or write some out for me, I would forever be in your debt!

In case it's of any relevance, im running Ubuntu 13.04 64bit Wine version 1.4.1

  • Have you tried the version of Wine from the wine PPA (follow the relatively simple instructions here winehq.org/download/ubuntu)? Add the PPA, then check for updates and install the latest wine version. If that doesn't work, you can try uninstalling the version of Wine you have and installing the wine1.5 package with the Software Center. – Richard Jul 27 '13 at 20:48
  • Yes I did try that. But it seems this is a long standing problem with wine and games that use EAX. It's not fixed in any version of wine so far. – squiz Jul 28 '13 at 8:40
  • Ah yes, otherwise the bug would be marked as fixed... In order to patch Wine, you would have to compile it directly from source, which is a very lengthy process that also requires a lot of hard disk space (probably up to a few gigabytes). However, it is possible to do. I will post a guide on how to do that as an answer, and then you may choose whether or not you want to go through all that! – Richard Jul 28 '13 at 16:35
  • Fine with me. I have lots of free time right now! I'd be very grateful for a guide. I'm enjoying learning linux. Space won't be an issue. Thanks in advance :D – squiz Jul 29 '13 at 1:52
  • No problem - but let's hope it actually works. It will be finished tomorrow morning when Wine is finished compiling! I have wanted to try this for a long time with Wine's USB project. – Richard Jul 29 '13 at 3:39

When applications are written, they are simply a large group of text files called the source code that developers have typed out in whatever programming language they have chosen to write the program in. To actually run the program, these files need to be compiled using a software program called a "compiler" into binaries. Binaries are the files that are computer-readable, and when programs are distributed or downloaded through the Software Center they are the compiled and packaged versions of the program.

Software patches are files that describe changes to be made to the source code. patch is the name of the program used to patch source code. To patch software, you download (or create) a patch file and use the patch program on the patch file to patch the source code (confusing!).

This takes a long time for big programs like Wine, but it can be done. In your situation, you will need to remove the Wine package you have installed, download and extract the Wine source code (making sure it is roughly the same software version), apply the patch, and then compile and install the patched source code. This will be easily accomplished using the terminal with tools provided by the apt software management suite. You can open the Terminal from the dash or with ctrl - alt - T.

After you open the Terminal, remove the packaged version of Wine that you got from the software center along with all of the other packages it relies on, and all of their configuration files with the command below, which you can copy and paste. This will not remove all of the Wine programs, like GTA, that you have installed.

sudo apt-get -y purge wine && sudo apt-get -y --purge autoremove

This and every other command that starts with "sudo" will require that you type in your password, which will not appear, and then press [Enter]. It provides programs with administrator/root priveleges. When this finishes and you are at a prompt (denoted with the $ symbol) again, create a new folder and move into it. This will create a folder called "wine" in your Downloads folder. I don't know if you want all of this going into your Downloads folder, but you can modify it to taste - just don't delete the folder!

mkdir ~/Downloads/Wine
cd ~/Downloads/Wine

Next, download the source code for Wine from the Ubuntu repositories, and cd to the Wine source tree.

sudo apt-get -y build-dep wine1.4
apt-get source wine
cd wine1.4-1.4.1/

A long list of packages will be installed and the source code will be downloaded and checked (you can ignore any warnings). When finished, download and apply the patch so that your game will work correctly. The echo command combined with the use of >> will add a newline to the end of the patch file - which Dropbox stripped - so that the patch command will not complain. The apt-get commands install the wget program, which is a command line tool for downloading files from the web.

sudo apt-get -y install wget
wget https://www.dropbox.com/s/0c9e1qjurpjxi3m/patchfile1.patch
patch -p1 < patchfile1.patch
dpkg-buildpackage -rfakeroot -b

It would be advisable to go get a coffee, or two, or three at this point, because it will take a loooooooonnnnnnnnnnngggg time to compile Wine!

Once that is all finished and you see the $ again, change one directory up and install the packaged version of the freshly compiled source code.

cd ..
sudo dpkg -i *.deb

Hope it works!

  • If you have questions about any of the commands or what they're doing don't hesitate to comment, also you may receive some compiling errors that need to be hashed out. – Richard Jul 29 '13 at 13:57
  • Brilliant. Makes a lot more sense. Thanks very much. I appreciate the work. I'll get onto it right now :D – squiz Jul 29 '13 at 21:40
  • What about if I start with the latest Wine source from git://source.winehq.org/git/wine.git instead of the source from the Ubuntu repos? How do I apply a patch to this? – Aaron Franke Mar 16 '18 at 3:43
  • I am getting Patch format detection failed. when I use git am patch.patch – Aaron Franke Mar 16 '18 at 3:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.