KnowHow

技術的なメモを中心にまとめます。
検索にて調べることができます。

WineHQインストール(2):システムに変更を加えない手順

登録日 :2025/05/18 08:27
カテゴリ :Linux

Wine本体を「システムに変更を加えず、ホームディレクトリだけにすべてインストールしたい」という場合、パッケージ管理システム(dnfやapt)を使わず、自分のホームディレクトリにソースからWineをビルドしてインストールする方法が現実的です。

解説

通常のdnf install wineなどの方法では、Wine本体(バイナリやライブラリ)は/usr/binや/usr/libなどシステム領域にインストールされ、root権限が必要です。

しかし、ソースコードからビルドし、--prefixオプションでホームディレクトリ配下(例:$HOME/wine)を指定してインストールすれば、システムには一切変更を加えずにWineを利用できます。

手順(例)

必要な開発ツールやライブラリをインストール
これは一度だけroot権限が必要ですが、以降は不要です。

sudo dnf groupinstall "Development Tools"
sudo dnf builddep wine

※オフラインでbuildappを行うには
まず、オンライン環境で必要なライブラリをダウンロードする。

sudo dnf builddep --downloadonly --downloaddir=./wine_builddep wine

当該ライブラリをすべて対象マシンに移動して、インストールする

sudo dnf install ./*.rpm

Wineのソースコードをダウンロード

cd ~
wget https://dl.winehq.org/wine/source/10.x/wine-10.7.tar.xz
tar xvf wine-10.7.tar.xz
cd wine-10.7

ホームディレクトリ配下にインストール先を指定してビルド

./configure --prefix=$HOME/wine
make
make install

パスを通す

export PATH=$HOME/wine/bin:$PATH

Wineの利用

$HOME/wine/bin/winecfg

以降、$HOME/wine/bin/wineでWineを利用できます。

補足

  • Wineの仮想Cドライブや設定(プレフィックス)はもともとホームディレクトリ以下(例:~/.wine)に作成されます。
  • システムを汚さず、ユーザー単位で完結したWine環境を構築できます。
  • 他ユーザーやシステム全体には影響しません。

まとめ

  • システムに変更を加えず、Wine本体をホームディレクトリにインストールすることは可能です。
  • 方法は「ソースからビルドし、--prefix=$HOME/xxxでインストール」。
  • 以降は$HOME/wine/bin/wineなどでWineを起動できます。
  • この方法なら、管理者権限がない環境や、システムを汚したくない場合でもWineを利用できます

インストールをしてみる

オンライン環境でwineのビルド環境パッケージを入手する
※/home/APPLI/wine に保存する

[root@rpmbuild wine]# sudo dnf builddep --downloadonly --downloaddir=./wine_builddep wine
appstream-source リポジトリーの有効化
baseos-source リポジトリーの有効化
Rocky Linux 8 - AppStream                                             2.0 kB/s | 4.8 kB     00:02
Rocky Linux 8 - AppStream                                             1.1 MB/s |  18 MB     00:17
Rocky Linux 8 - BaseOS                                                2.4 kB/s | 4.3 kB     00:01
Rocky Linux 8 - BaseOS                                                1.4 MB/s |  23 MB     00:16
Rocky Linux 8 - Extras                                                2.3 kB/s | 3.1 kB     00:01
Rocky Linux 8 - Extras                                                9.6 kB/s |  15 kB     00:01
Rocky Linux 8 - BaseOS - Source                                       356 kB/s | 556 kB     00:01
Rocky Linux 8 - AppStream - Source                                    527 kB/s | 1.0 MB     00:01
一致するパッケージはありません: wine
エラー: 一部のパッケージは見つかりませんでした。
[root@rpmbuild wine]#
[root@rpmbuild wine]# ls
wine_builddep
[root@rpmbuild wine]# cd wine_builddep/
[root@rpmbuild wine_builddep]# ls

このエラーは「一致するパッケージはありません: wine」とある通り、Rocky Linux 8/9の標準リポジトリにはwineのSRPM(ソースパッケージ)が存在しないため、dnf builddep wineが機能しないことが原因です。

背景
- RHEL系(Rocky Linux含む)では、Wineの公式SRPMや.specファイルが標準リポジトリで提供されていません。
- そのため、dnf builddep wineやdnf builddep --downloadonly ... wineは使えません。
- Wineをビルドしたい場合は、Wine公式サイトからソースコードを取得し、必要なビルド依存パッケージを自分で調べてインストールする必要があります。

そのため、無視してソースコードをダウンロードしてコンパイルを検証する

[root@rpmbuild wine_source]# wget https://dl.winehq.org/wine/source/10.x/wine-10.7.tar.xz
--2025-05-18 09:53:21--  https://dl.winehq.org/wine/source/10.x/wine-10.7.tar.xz
dl.winehq.org (dl.winehq.org) DNSに問いあわせています... 151.101.90.217, 2a04:4e42:15::729
dl.winehq.org (dl.winehq.org)|151.101.90.217|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 32394436 (31M) [application/x-tar]
`wine-10.7.tar.xz' に保存中

wine-10.7.tar.xz          100%[===================================>]  30.89M   236KB/s 時間 2m 8s

2025-05-18 09:55:33 (246 KB/s) - `wine-10.7.tar.xz' へ保存完了 [32394436/32394436]

[root@rpmbuild wine_source]# ls
wine-10.7.tar.xz
[root@rpmbuild wine_source]# tar xvf wine-10.7.tar.xz
wine-10.7/
wine-10.7/.editorconfig
wine-10.7/.gitattributes

wine-10.7/tools/wrc/wrc.man.in
wine-10.7/tools/wrc/wrctypes.h
[root@rpmbuild wine_source]#

ホームディレクトリにインストール先を指定してビルド

[root@rpmbuild wine-10.7]# ./configure --prefix=/home/APPLI/wine
[root@rpmbuild wine-10.7]# ./configure --prefix=/home/APPLI/wine
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking for clang++... no
checking whether the compiler supports GNU C++... no
checking whether g++ accepts -g... no
checking for g++ option to enable C++11 features... unsupported
checking for g++ option to enable C++98 features... unsupported
checking for cpp... cpp
checking for ld... ld
checking whether gcc -m32 works... no
configure: error: Cannot build a 32-bit program, you need to install 32-bit development libraries.
[root@rpmbuild wine-10.7]#

コンパイルのライブラリダウンロード

[root@rpmbuild wine_builddep]# sudo dnf install --downloadonly --downloaddir=./ gcc-c++
[root@rpmbuild wine_builddep]# sudo dnf install --downloadonly --downloaddir=./wine_i686 glibc-devel.i686 libgcc.i686 libstdc++.i686

ライブラリをインストールする

[root@rpmbuild gcc]# ls
cpp-8.5.0-26.el8_10.x86_64.rpm                 libgcc-8.5.0-26.el8_10.x86_64.rpm
gcc-8.5.0-26.el8_10.x86_64.rpm                 libgomp-8.5.0-26.el8_10.x86_64.rpm
gcc-c++-8.5.0-26.el8_10.x86_64.rpm             libstdc++-8.5.0-26.el8_10.x86_64.rpm
gcc-plugin-annobin-8.5.0-26.el8_10.x86_64.rpm  libstdc++-devel-8.5.0-26.el8_10.x86_64.rpm
[root@rpmbuild gcc]# sudo dnf install ./*.rpm

gccのインストールだけでは、やはりだめ

[root@rpmbuild wine-10.7]# ./configure --prefix=/home/APPLI/wine
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking for g++... g++
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking for cpp... cpp
checking for ld... ld
checking whether gcc -m32 works... no
configure: error: Cannot build a 32-bit program, you need to install 32-bit development libraries.
[root@rpmbuild wine-10.7]#

32bitコンパイラ関係のインストール

[root@rpmbuild wine_i686]# ls
glibc-2.28-251.el8_10.16.i686.rpm                  glibc-headers-2.28-251.el8_10.16.i686.rpm
glibc-2.28-251.el8_10.16.x86_64.rpm                glibc-headers-2.28-251.el8_10.16.x86_64.rpm
glibc-all-langpacks-2.28-251.el8_10.16.x86_64.rpm  glibc-langpack-en-2.28-251.el8_10.16.x86_64.rpm
glibc-common-2.28-251.el8_10.16.x86_64.rpm         glibc-langpack-ja-2.28-251.el8_10.16.x86_64.rpm
glibc-devel-2.28-251.el8_10.16.i686.rpm            libgcc-8.5.0-26.el8_10.i686.rpm
glibc-devel-2.28-251.el8_10.16.x86_64.rpm          libstdc++-8.5.0-26.el8_10.i686.rpm
glibc-gconv-extra-2.28-251.el8_10.16.i686.rpm      libxcrypt-4.1.1-6.el8.i686.rpm
glibc-gconv-extra-2.28-251.el8_10.16.x86_64.rpm    libxcrypt-devel-4.1.1-6.el8.i686.rpm
[root@rpmbuild wine_i686]# sudo dnf install ./*.rpm

まだ足りないflexパッケージが必要とのこと

[root@rpmbuild wine_builddep]# sudo dnf install --downloadonly --downloaddir=./flex_rpm flex
[root@rpmbuild wine_builddep]# ls flex_rpm/
flex-2.6.1-9.el8.x86_64.rpm  m4-1.4.18-7.el8.x86_64.rpm
[root@rpmbuild wine_builddep]#
[root@rpmbuild flex_rpm]# ls
flex-2.6.1-9.el8.x86_64.rpm  m4-1.4.18-7.el8.x86_64.rpm
[root@rpmbuild flex_rpm]# sudo dnf install ./*.rpm

まだ足りない、bisonがいるとのこと

sudo dnf install --downloadonly --downloaddir=./bison_rpm bison
sudo dnf install ./bison_rpm/*.rpm

まだ足りない。X11の32ビットパッケージが必要とのこと

sudo dnf install --downloadonly --downloaddir=./x11_i686 \
  libX11-devel.i686 libXext-devel.i686 libXcursor-devel.i686 \
  libXi-devel.i686 libXrandr-devel.i686 libXrender-devel.i686 \
  libXfixes-devel.i686 libxcb-devel.i686 libXinerama-devel.i686 \
  libXcomposite-devel.i686 libXxf86vm-devel.i686
sudo dnf install ./*.rpm

まだ足りない、次はフォント

[root@rpmbuild wine_builddep]# sudo dnf install --downloadonly --downloaddir=./freetype_i686 freetype-devel.i686
sudo dnf install ./freetype_i686/*.rpm
export PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig

まだ足りない、

sudo dnf install --downloadonly --downloaddir=./wine_i686_deps \
  zlib-devel.i686 bzip2-devel.i686 libpng-devel.i686
sudo dnf install ./wine_i686_deps/*.rpm

ライブラリ参照できているかのチェック

PKG_CONFIG_PATH=/usr/lib/pkgconfig pkg-config --cflags freetype2
[root@rpmbuild wine_builddep]# PKG_CONFIG_PATH=/usr/lib/pkgconfig pkg-config --cflags freetype2
-I/usr/include/freetype2 -I/usr/include/libpng16
[root@rpmbuild wine_builddep]#

wineのインストールディスクの変更設定を実施

[root@rpmbuild wine-10.7]# ./configure --prefix=/home/APPLI/wine

これで、configureはひとまず成功。

configureが成功したら、make、make install を実施する

makeでさらにライブラリをインストールする

# sudo dnf install --downloadonly --downloaddir=./wine_libgcc glibc-devel.i686 libgcc.i686 libstdc++-devel.i686
# sudo dnf install ./wine_libgcc/*.rpm

SElinuxを無効化しておく

[root@rpmbuild wine_builddep]# getenforce
Enforcing
[root@rpmbuild wine_builddep]# setenforce 0
[root@rpmbuild wine_builddep]# getenforce
Permissive

makeする。失敗する可能性もあるため、V=1オプションをつけて詳細ログも出しておく

make clean
make V=1
make install

makeするだけでもかなり時間がかかる。容量も1~2GB必要。

[root@rpmbuild wine-10.7]# make V=1 2>&1 | tee memo_20250518_2.log


LC_ALL=C sed -e 's,@bindir@,/home/APPLI/wine/bin,g' -e 's,@PACKAGE_STRING@,Wine 10.7,g' -e 's,@PACKAGE_VERSION@,10.7,g' tools/winegcc/winegcc.man.>tools/winegcc/winegcc.man || (rm -f tools/winegcc/winegcc.man && false)
rm -f tools/winegcc/winecpp && ln -s winegcc tools/winegcc/winecpp
rm -f tools/winegcc/wineg++ && ln -s winegcc tools/winegcc/wineg++
LC_ALL=C sed -e 's,@bindir@,/home/APPLI/wine/bin,g' -e 's,@PACKAGE_STRING@,Wine 10.7,g' -e 's,@PACKAGE_VERSION@,10.7,g' tools/winemaker/winemaker.UTF-8.man.in >tools/winemaker/winemaker.de.UTF-8.man || (rm -f tools/winemaker/winemaker.de.UTF-8.man && false)
LC_ALL=C sed -e 's,@bindir@,/home/APPLI/wine/bin,g' -e 's,@PACKAGE_STRING@,Wine 10.7,g' -e 's,@PACKAGE_VERSION@,10.7,g' tools/winemaker/winemaker.UTF-8.man.in >tools/winemaker/winemaker.fr.UTF-8.man || (rm -f tools/winemaker/winemaker.fr.UTF-8.man && false)
LC_ALL=C sed -e 's,@bindir@,/home/APPLI/wine/bin,g' -e 's,@PACKAGE_STRING@,Wine 10.7,g' -e 's,@PACKAGE_VERSION@,10.7,g' tools/winemaker/winemaker..in >tools/winemaker/winemaker.man || (rm -f tools/winemaker/winemaker.man && false)
LC_ALL=C sed -e 's,@bindir@,/home/APPLI/wine/bin,g' -e 's,@PACKAGE_STRING@,Wine 10.7,g' -e 's,@PACKAGE_VERSION@,10.7,g' tools/wmc/wmc.man.in >toolmc/wmc.man || (rm -f tools/wmc/wmc.man && false)
LC_ALL=C sed -e 's,@bindir@,/home/APPLI/wine/bin,g' -e 's,@PACKAGE_STRING@,Wine 10.7,g' -e 's,@PACKAGE_VERSION@,10.7,g' tools/wrc/wrc.man.in >toolrc/wrc.man || (rm -f tools/wrc/wrc.man && false)
Wine build complete.
[root@rpmbuild wine-10.7]# make install 2>&1 | tee make_install_20250519_2.log

STRIPPROG="strip" tools/install-sh  tools/winegcc/winegcc /home/APPLI/wine/bin/winegcc
tools/install-sh -d /home/APPLI/wine/bin && rm -f /home/APPLI/wine/bin/winecpp && ln -s winegcc /home/APPLI/wine/bin/winecpp
tools/install-sh -d /home/APPLI/wine/bin && rm -f /home/APPLI/wine/bin/wineg++ && ln -s winegcc /home/APPLI/wine/bin/wineg++
tools/install-sh -m 644  tools/winemaker/winemaker.de.UTF-8.man /home/APPLI/wine/share/man/de.UTF-8/man1/winemaker.1
tools/install-sh -m 644  tools/winemaker/winemaker.fr.UTF-8.man /home/APPLI/wine/share/man/fr.UTF-8/man1/winemaker.1
tools/install-sh -m 644  tools/winemaker/winemaker.man /home/APPLI/wine/share/man/man1/winemaker.1
tools/install-sh  tools/winemaker/winemaker /home/APPLI/wine/bin/winemaker
tools/install-sh -m 644  tools/wmc/wmc.man /home/APPLI/wine/share/man/man1/wmc.1
STRIPPROG="strip" tools/install-sh  tools/wmc/wmc /home/APPLI/wine/bin/wmc
tools/install-sh -m 644  tools/wrc/wrc.man /home/APPLI/wine/share/man/man1/wrc.1
STRIPPROG="strip" tools/install-sh  tools/wrc/wrc /home/APPLI/wine/bin/wrc
[root@rpmbuild wine-10.7]# 

WineHQのインストール結果
/home/APPLI/wine にインストールされているようである。

[root@rpmbuild wine]# pwd
/home/APPLI/wine

[root@rpmbuild wine]# ll
合計 4
drwxr-xr-x.  2 root root 4096  5 19 04:37 bin
drwxr-xr-x.  3 root root   18  5 19 04:36 include
drwxr-xr-x.  3 root root   18  5 19 04:18 lib
drwxr-xr-x.  5 root root   49  5 19 04:35 share

インストールできていれば、バージョンを確認することができる

[root@rpmbuild wine]# /home/APPLI/wine/bin/wine --version
wine-10.7
[root@rpmbuild wine]#
[root@rpmbuild wine]# /home/APPLI/wine/bin/wine --version
wine-10.7
[root@rpmbuild wine]# ldd /home/APPLI/wine/bin/wine
        linux-gate.so.1 (0xf7ecf000)
        libdl.so.2 => /lib/libdl.so.2 (0xf7eb7000)
        libc.so.6 => /lib/libc.so.6 (0xf7d0e000)
        /lib/ld-linux.so.2 (0xf7ed1000)
[root@rpmbuild wine]# file /home/APPLI/wine/bin/wine
/home/APPLI/wine/bin/wine: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=b881a489e0d3decde91e23ced6fd698785b0df4a, with debug_info, not stripped
[root@rpmbuild wine]# ls -ld /home/APPLI/wine/bin/wine
-rwxr-xr-x. 1 root root 33472  5 19 04:35 /home/APPLI/wine/bin/wine
[root@rpmbuild wine]#

しかし、rpmbuildを行ったRockyLinux8.8マシンが、当該ディレクトリをマウントして実行しようとしたところ、うまくいかない。

[root@headnode ~]#
[root@headnode ~]# ls /home/APPLI/wine/bin/wine
/home/APPLI/wine/bin/wine
[root@headnode ~]# file /home/APPLI/wine/bin/wine
/home/APPLI/wine/bin/wine: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=b881a489e0d3decde91e23ced6fd698785b0df4a, with debug_info, not stripped
[root@headnode ~]#
[root@headnode ~]# /home/APPLI/wine/bin/wine --version
-bash: /home/APPLI/wine/bin/wine: そのようなファイルやディレクトリはありません
[root@headnode ~]#
[root@headnode ~]# ldd /home/APPLI/wine/bin/wine
        動的実行ファイルではありません
[root@headnode ~]#

結局、Wineを別のマシンから実行するには、そのマシンにも32ビット環境のインストールを行う必要がある、ということかもしれません。

調べたところ、PATH(コマンドサーチパス)を通すことでコマンド自体は認識されますが、WineのようなELFバイナリが依存するglibcやlibstdc++などの32bitシステムライブラリは、PATHではなくシステムの標準ライブラリパス(/lib, /lib32, /usr/lib, /usr/lib32など)からロードされます。

そのため、/home/APPLI/wine/lib へのPATH追加だけでは、glibc.i686などのシステムライブラリ不足は解決できません。
LD_LIBRARY_PATHを使って一部のユーザー空間ライブラリを見せることはできますが、glibcなどの基本的なランタイムライブラリは安全にユーザー領域だけで差し替えることはできません。
また、Wineのような複雑なバイナリは多くの32bitシステムライブラリを必要とし、これらはOSの標準パスにインストールされている必要があります。

sudo dnf install glibc.i686 libstdc++.i686

では、マウントしたクライアントノードは、最低限何をインストールすればよいのか。
Step1

# sudo dnf install --downloadonly --downloaddir=./wine_glibc_1 glibc.i686 libstdc++.i686
# sudo dnf install ./wine_glibc_1/*.rpm
[root@compute01 wine]# ls
wine_glibc_1
[root@compute01 wine]# ls wine_glibc_1
glibc-2.28-251.el8_10.16.i686.rpm                  glibc-gconv-extra-2.28-251.el8_10.16.i686.rpm    libgcc-8.5.0-26.el8_10.i686.rpm
glibc-2.28-251.el8_10.16.x86_64.rpm                glibc-gconv-extra-2.28-251.el8_10.16.x86_64.rpm  libgcc-8.5.0-26.el8_10.x86_64.rpm
glibc-all-langpacks-2.28-251.el8_10.16.x86_64.rpm  glibc-langpack-en-2.28-251.el8_10.16.x86_64.rpm  libstdc++-8.5.0-26.el8_10.i686.rpm
glibc-common-2.28-251.el8_10.16.x86_64.rpm         glibc-langpack-ja-2.28-251.el8_10.16.x86_64.rpm
[root@compute01 wine]#

※これをインストールするとき、64ビットライブラリのバージョン不一致で競合したら、アップデートが必要なこともある

sudo dnf upgrade libstdc++.x86_64

インストール後、無事にWineを実行できることが確認できた

ライブラリインストール前
[root@compute01 wine]#
[root@compute01 wine]# /home/APPLI/wine/bin/wine --version
-bash: /home/APPLI/wine/bin/wine: そのようなファイルやディレクトリはありません
[root@compute01 wine]# ldd /home/APPLI/wine/bin/wine
        動的実行ファイルではありません
[root@compute01 wine]# 

ライブラリをインストールする
[root@compute01 wine]# sudo dnf install ./wine_glibc_1/*.rpm

ライブラリインストール後
[root@compute01 wine]# ldd /home/APPLI/wine/bin/wine
        linux-gate.so.1 (0xf7f69000)
        libdl.so.2 => /lib/libdl.so.2 (0xf7f52000)
        libc.so.6 => /lib/libc.so.6 (0xf7da9000)
        /lib/ld-linux.so.2 (0xf7f6b000)
[root@compute01 wine]# /home/APPLI/wine/bin/wine --version
wine-10.7

Wineには、64ビット版もコンパイル可能であることがわかりました。
インストール先を指定してビルドするには以下の通り

./configure --prefix=/root/wine --enable-win64

ただし、これだと64ビット版のコンパイルのみになってしまうので、32ビット版と合わせて環境構築をしておいたほうがいいと思われます。
WoW64構成(64bit/32bit両対応)のWineを自分でビルド・導入する手順は以下の通りです。
この構成では64bitアプリも32bitアプリも同じWine環境で動作します。

# 64bitビルド
mkdir wine64
cd wine64
../../wine-source/configure --prefix=/root/wine --enable-win64
make

# 32bitビルド
cd ..
mkdir wine32
cd wine32
../../wine-source/configure --prefix=/root/wine --with-wine64=../wine-64
make

# インストール
cd ../wine32
make install  # wine32ディレクトリで
cd ../wine64
make install  # wine64ディレクトリで

インストール後、Wineで64bit環境と32bit環境を切り分けて使う方法は、主に「Wine Prefix」と「WINEARCH環境変数」を使うことで実現します。

64bit LinuxでWineをインストールすると、デフォルトでは64bitのWine Prefix(仮想Windows環境)が作成されます

32bit専用のWine Prefixを作りたい場合は、WINEARCH=win32環境変数を指定してwineコマンドを実行します

# 例: 新規に32bit環境を作成
WINEARCH=win32 WINEPREFIX=~/win32prefix winecfg

64bit専用のWine Prefixを作りたい場合は、WINEARCH=win64(または省略)でwineコマンドを実行します

# 例: 新規に64bit環境を作成
WINEARCH=win64 WINEPREFIX=~/win64prefix winecfg
# または
WINEPREFIX=~/win64prefix winecfg

まとめ:環境(Prefix)の構築は、最初の1回だけ実行すればOK

WINEARCH=win32 WINEPREFIX=~/wineprefix32 winecfg
WINEARCH=win64 WINEPREFIX=~/wineprefix64 winecfg

これにより、~/wineprefix32(32bit専用)と~/wineprefix64(64bit専用)のWine環境(Prefix)が作成されます。

以降、アプリの実行も同じWINEPREFIXを指定して行います。
これらのコマンドは、Wineインストール後に一度だけ実行すればよいものではなく、
「そのPrefix(環境)でアプリを実行したい時に毎回指定して実行する必要があります」

WINEPREFIX=~/win32prefix wine yourapp.exe   # 32bit環境で実行
WINEPREFIX=~/win64prefix wine yourapp.exe   # 64bit環境で実行

Prefixのアーキテクチャの確認

grep '#arch' ~/wineprefix32/system.reg
# 出力例: #arch=win32
grep '#arch' ~/wineprefix64/system.reg
# 出力例: #arch=win64

実行時には、使いたいPrefixをWINEPREFIXで毎回指定してアプリを起動します。
Prefixの再作成は不要です。

まとめ
Prefixの作成(winecfg)は1回だけでOK。
アプリ実行時は、毎回WINEPREFIXで使いたい環境を指定して実行。

注意点
既存のWine Prefix(例:~/.wine)がある場合、異なるアーキテクチャで再利用はできません。新しいPrefixを作るか、既存を削除してから作り直してください。
64bit Wineは32bitアプリも多くの場合動作しますが、問題が出る場合は32bit Prefixを使うのが安全です


Wineについていろいろと調べたものの、RockyLinuxでは、32ビット開発ツールの提供が不足しており、32ビット環境の構築は完全には出来ない模様であることがわかってきた。
configureで必要な以下のパッケージがインストールできない。
引数に一致する結果がありません: libdbus-devel.i686
引数に一致する結果がありません: libgnutls-devel.i686
引数に一致する結果がありません: libasound-devel.i686
引数に一致する結果がありません: libudev-devel.i686
引数に一致する結果がありません: libkrb5-devel.i686

そのため、32ビットのWindowsアプリ(インストーラなど)を実行する際にGUIのインストール画面が表示できずに進められないようである。