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

2014-04-22 16:04:28

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:

[php]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".[/php]

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.

[php]cd $HOME
git clone git://source.winehq.org/git/wine.git ~/wine-git[/php]

Get the 64 bit prerequisites, e.g.

[php]sudo apt-get build-dep wine[/php]

Build 64 bit wine, e.g.

[php]cd $HOME
mkdir wine64
cd wine64
../wine-git/configure –enable-win64
make -j4[/php]

Install lxc:

[php]sudo apt-get install lxc[/php]

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

[php]sudo lxc-create -t ubuntu -n my32bitbox — –bindhome $LOGNAME -a i386[/php]

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

[php]sudo lxc-start -n my32bitbox[/php]

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:

[php]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[/php]

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:

[php]cd $HOME
mkdir wine32
cd wine32
~/wine-git/configure –with-wine64=$HOME/wine64 –with-wine-tools=$HOME/wine32-tools
make -j4[/php]

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

[php]cd $HOME
cd wine32
sudo make install[/php]

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

[php]sudo shutdown -h now[/php]

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

[php]cd $HOME/wine32
sudo make install
cd $HOME/wine64
sudo make install[/php]

And you’re done!

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

ubuntu默认root密码

安装完Ubuntu后忽然意识到没有设置root密码,不知道密码自然就无法进入根用户下。到网上搜了一下,原来是这么回事: Ubuntu的默认root密码是随机的,即每次开机都有一个新的root密码。我们可以在终端输入命令: `sudo passwd` 然后输入当前用户的密码,enter,终端会提示我们输入新的密码并确认,此时的密码就是root新密码。修改成功后,输入命令 : `su root` 再输入新的密码就ok了。

DOS批处理中%cd%和%~dp0的区别

在DOS的批处理中,有时候需要知道当前的路径。在DOS中,有两个环境变量可以跟当前路径有关,一个是%cd%, 一个是%~dp0。这两个变量的用法和代表的内容是不同的: 1. %cd% 可以用在批处理文件中,也可以用在命令行中;展开后,是驱动器盘符:+当前目录,如在dos窗口中进入c:\dir目录下面,输入:echo %cd% ,则显示为:c:\dir 。 %cd%的内容是可以被改变的,其内容为命令的执行路径或批处理文件的执行路径。 2.%~dp0只可以用在批处理文件中,它是由它所在的批处理文件的目录位置决定的,是批处理文件所在的盘符:+路径。在执行这个批处理文件的过程中,它展开后的内容是不可以改变的。比如在D盘下有个批处理文件,path.bat,其内容为: 复制代码代码如下: @echo off echo this is %%cd%% %cd% echo this is %%~dp0