我仔细尝试了这里的所有步骤:https://wiki.winehq.org/Ubuntu
(其核心相当于这里的内容:如何安装和配置 Wine?)
但是当尝试安装依赖项时,我最终遇到如下错误:
注意,选择“libasound2-data”而不是“libasound2-data:i386”
基本上,无论我怎么尝试,它都无法安装 i386...
如果某些包没有错误,它会要求我卸载大量我不想要的包......
关于常见问题解答https://wiki.winehq.org/FAQ#How_do_I_solve_dependency_errors_when_trying_to_install_Wine.3F
我启用的唯一额外存储库是:https://dl.winehq.org/wine-builds/ubuntu/
这意味着,没有其他可能导致冲突的 PPA,并且我在使用 vanilla ubuntu 20.04 时遇到了问题......
我无法绕过这个命令:
sudo apt install --install-recommends winehq-stable
即使尝试使用常见问题解答和其他提示......
在这个问题关闭之前(尽管我不同意),有人至少可以说一下,您是否设法在支持 i386(win32)的 ubuntu 20.04 上安装了 Wine?
尝试此命令:sudo add-apt-repository --remove 'deb https://dl.winehq.org/wine-builds /ubuntu/ focal main' && sudo apt update && sudo apt install -y wine32 wine64 wine-stable
失败:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies.
wine-stable : Depends: wine-stable-i386 (= 5.0.2~focal)
wine32:i386 : Depends: libwine:i386 (= 5.0-3ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
为什么它不会安装依赖项?它说“但它不会被安装”:(...
当尝试这些时:
$sudo apt install --install-recommends winehq-stable #requires wine-stable
$sudo apt install --install-recommends wine-stable #requires wine-stable-i386
$sudo apt install --install-recommends wine-stable-i386 #quite a mess...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies.
wine-stable-i386:i386 : Depends: libasound2:i386 (>= 1.0.16) but it is not going to be installed
Depends: libfaudio0:i386 (>= 19.06.07) but it is not going to be installed
Depends: libglib2.0-0:i386 (>= 2.12.0) but it is not going to be installed
Depends: libgphoto2-6:i386 (>= 2.5.10) but it is not going to be installed
Depends: libgphoto2-port12:i386 (>= 2.5.10) but it is not going to be installed
Depends: libgstreamer-plugins-base1.0-0:i386 (>= 1.0.0) but it is not going to be installed
Depends: libgstreamer1.0-0:i386 (>= 1.4.0) but it is not going to be installed
Depends: libldap-2.4-2:i386 (>= 2.4.7) but it is not going to be installed
Depends: libopenal1:i386 (>= 1.14) but it is not going to be installed
Depends: libpulse0:i386 (>= 0.99.1) but it is not going to be installed
Depends: libudev1:i386 (>= 183) but it is not going to be installed
Depends: libxml2:i386 (>= 2.9.0) but it is not going to be installed
Depends: libasound2-plugins:i386 but it is not going to be installed
Recommends: libcups2:i386 but it is not going to be installed
Recommends: libdbus-1-3:i386 but it is not going to be installed
Recommends: libglu1-mesa:i386 but it is not going to be installed or
libglu1:i386
Recommends: libosmesa6:i386 but it is not going to be installed
Recommends: libsane:i386 but it is not going to be installed or
libsane1:i386
Recommends: libsdl2-2.0-0:i386 but it is not going to be installed
Recommends: libtiff5:i386 but it is not going to be installed
Recommends: libxslt1.1:i386 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
最后,如果我尝试安装这些 i386 的东西,它会要求删除 1.5GB 的软件包,就像它想将我的系统转换为 32 位,但与 32 位不兼容……
尝试能力
$sudo aptitude install wine-stable-i386
# I see these as a problem
Remove the following packages:
1) mesa-vdpau-drivers [20.0.8-0ubuntu1~20.04.1 (now)]
2) vdpau-driver-all [1.3-1ubuntu2 (focal, now)]
Leave the following dependencies unresolved:
53) libgstreamer-plugins-base1.0-0:i386 recommends gstreamer1.0-plugins-base:i386
54) libvulkan1:i386 recommends mesa-vulkan-drivers:i386 | vulkan-icd:i386
55) libopenal1:i386 recommends libasound2:i386 (>= 1.0.16)
56) wine-stable-i386:i386 recommends libcups2:i386
57) wine-stable-i386:i386 recommends libdbus-1-3:i386
58) wine-stable-i386:i386 recommends libglu1-mesa:i386 | libglu1:i386
59) wine-stable-i386:i386 recommends libosmesa6:i386
60) wine-stable-i386:i386 recommends libsane:i386 | libsane1:i386
61) wine-stable-i386:i386 recommends libsdl2-2.0-0:i386
62) wine-stable-i386:i386 recommends libtiff5:i386
63) wine-stable-i386:i386 recommends libxslt1.1:i386
如果我尝试选择它们,aptitude 将永远不会停止尝试计算东西,并产生大量的“包 x 破坏包 y”和大量冲突:
$sudo aptitude install wine-stable-i386 gstreamer1.0-plugins-base:i386 mesa-vulkan-drivers:i386 libasound2:i386 libcups2:i386 libdbus-1-3:i386 libglu1-mesa:i386 libosmesa6:i386 libsane:i386 libsdl2-2.0-0:i386 libtiff5:i386 libxslt1.1:i386
实际上,aptitude 只是让我害怕...我不想只是为了运行 win32 的东西而弄乱我的系统。
我正在检查chroot
现在可以做什么,我不想弄乱我的操作系统......
答案1
这些说明适用于 20.04 ubuntu focal,但可能适用于其他版本。
基于https://wiki.winehq.org/Building_Wine#Chroot
$ sudo apt-get install schroot debootstrap
使用例如创建此文件:sudo geany /etc/schroot/chroot.d/ubuntu_i386.conf
并在其上正确设置您的用户名!
$ cat /etc/schroot/chroot.d/ubuntu_i386.conf
[ubuntu_i386]
description=Ubuntu Release 32-Bit
personality=linux32
directory=/srv/chroot/ubuntu_i386
root-users=YOURUSERNAME
type=directory
users=YOURUSERNAME
$ sudo mkdir -p /srv/chroot/ubuntu_i386
焦点在哪里使用您的发布名称!!!
$ sudo debootstrap --variant=minbase --arch=i386 focal /srv/chroot/ubuntu_i386 http://archive.ubuntu.com/ubuntu/
$ sudo cp /etc/apt/sources.list /srv/chroot/ubuntu_i386/etc/apt/
这将生成一个供稍后使用的命令行!
$ echo apt install `apt-cache depends ubuntu-minimal |egrep -v ":i386|ubuntu-minimal" |sed -e 's"Depends:""' -e 's"Recommends:""' |tr -d '\n'`
apt install ... # copy it
进入 CHROOT
$ schroot -c ubuntu_i386 -u root
$ apt-get update
$ apt-get install ubuntu-minimal # this may fail
如果apt-get install ubuntu-minimal
失败,请使用上面复制的apt install ...
。我不得不删除一些包,结果在焦点上是这样的:apt install adduser apt apt-utils bzip2 debconf debconf-i18n e2fsprogs init iproute2 kmod less locales lsb-release mawk mount netbase netcat-openbsd passwd procps python3 sensible-utils sudo tzdata ubuntu-keyring udev vim-tiny whiptail
$ apt-get install wine # put a happy smile here! :)
$ exit
现在在 HOST 上(基于https://unix.stackexchange.com/a/47579/30352):
让我们授予它可以在主机中运行X应用程序的
权限复制下面一行,注意第一个参数“YourPCName / unix:”可能没有显示号码!!!
$ xauth list
YourPCName/unix: MIT-MAGIC-COOKIE-1 39825672cb45c29b7c49b7
如果需要,请记下下面您将需要的显示号码
$ declare -p DISPLAY
declare -x DISPLAY=":1"
以普通用户身份返回 chroot
$ schroot -c ubuntu_i386
在 CHROOT 中,
需要在 ':' 后显示数字
$ xauth add "YourPCName/unix:1" "MIT-MAGIC-COOKIE-1" "39825672cb45c29b7c49b7"
$ xauth list #confirm it worked
YourPCName/unix:1 MIT-MAGIC-COOKIE-1 39825672cb45c29b7c49b7
QOL,这里也使用显示号码
$ export DISPLAY=:1
$ xterm # test it!
$ wine explorer # test with a smile! :)
对于mount --bind
schroot 内的目录,请使用以下指令:https://unix.stackexchange.com/a/609808/30352
基本上,您需要mount --bind
在/run/schroot/mount/ubuntu_i386-...
而不是在/srv/chroot/ubuntu_i386
!!!
Winetricks 需要cabextract
。使用以下命令
下载并安装这两个dpkg -i ...
:
https://launchpad.net/ubuntu/bionic/i386/libmspack0/0.6-3ubuntu0.3
https://launchpad.net/ubuntu/bionic/i386/cabextract/1.6-1.1
(是的,仿生包在焦点上起作用)
最终大小约为 1.2GB。