Building 32-bit Wine on a 64-bit Ubuntu system

I have been trying to install Wine on my 13.04 64 bit computer, and everytime it leads to synaptic asking for the uninstall of the entire system.

I have been following some questions which suggest the addition of the Wine repository (also recomended on the WineHQ) website, followed by sudo apt-get update and sudo apt-get install wine1.5.

The system cries, with the following messages:

1
2
3
4
5
6
7
8
9
10
11
12
13
root@ludis-Lenovo-IdeaPad-Y485:/home/ludis# sudo apt-get install wine1.5  
Building dependency tree
Reading state information … done
Some packages could not be installed. This can mean
you have requested an impossible situation or if you are using
the unstable distribution that some required packages have not yet
created or are not moved out of Incoming.
The following information should help you to resolve the situation:

The following packages have unmet dependencies:
wine: Depends: wine1.6 but will not be installed or
wine1.7 but will not install
E: Unable to correct problems, faulty packets mode "keep state".

I have tried all sudo apt-get autoclean and sudo apt-get autoremove and sudo apt-get update. However, the problem seems to continue. Any clues?

Finally, i solved by google:

The basic approach is:

1.build 64 bit wine

2.build 32 bit tools in lxc

3.build 32 bit wine in lxc, referring to the 64 bit wine and 32 bit tools built in the previous steps

4.install 32 bit wine

5.install 64 bit wine

Get the source, e.g.

1
2
cd $HOME  
git clone git://source.winehq.org/git/wine.git ~/wine-git

Get the 64 bit prerequisites, e.g.

1
sudo apt-get build-dep wine

Build 64 bit wine, e.g.

1
2
3
4
5
cd $HOME  
mkdir wine64
cd wine64
../wine-git/configure –enable-win64
make -j4

Install lxc:

1
sudo apt-get install lxc

Create a 32 bit container, and tell it to bind your home directory into the container:

1
sudo lxc-create -t ubuntu -n my32bitbox — –bindhome $LOGNAME -a i386

Start the container; at the console login prompt it gives you, log in with your username and password.

1
sudo lxc-start -n my32bitbox

Now you’re inside the container, in your real home directory. Do an out-of-tree build of Wine as normal, just to get the tools. You’ll have to install all the needed prerequisites first. For instance:

1
2
3
4
5
6
7
8
sudo apt-get install python-software-properties  
sudo apt-get build-dep wine
sudo apt-get install git-core
cd $HOME
mkdir wine32-tools
cd wine32-tools
~/wine-git/configure
make -j4

Still inside the container, do it again, this time pointing to the 64 bit build for data, and the 32 bit tools build for tools:

1
2
3
4
5
cd $HOME  
mkdir wine32
cd wine32
~/wine-git/configure –with-wine64=$HOME/wine64 –with-wine-tools=$HOME/wine32-tools
make -j4

Still inside the container, install the 32 bit wine to force the last little bit of building:

1
2
3
cd $HOME  
cd wine32
sudo make install

Still inside the container, shut down the container with the command

1
sudo shutdown -h now

This drops you back out into your real machine. Finally, install into your real machine:

1
2
3
4
cd $HOME/wine32  
sudo make install
cd $HOME/wine64
sudo make install

And you’re done!

Note: You don’t need LXC, you can simply use a chroot.

Author

Ludis

Posted on

2014-04-22

Updated on

2014-04-22

Licensed under

Comments