【银河麒麟】银河麒麟桌面操作系统 V10 (SP1) 2403 版(ARM64)安装 Windows 软件(Wine)
零、注意事项
本教程仅针对“银河麒麟桌面操作系统 V10(SP1) 2403 版”,如你需要 2303 版本系统的安装教程,请见【ARM版银河麒麟安装windows应用程序】。非 2403 版本系统通过本方法安装可能出现依赖冲突,甚至造成系统损坏(但是不会破坏你的备份,只是桌面进不去,遇到问题直接还原即可)。
请注意,Wine 并不能保证运行所有 Windows 程序,大部分程序不能完美的运行在 Linux 上,甚至可能完全不能运行。
安装前,请尽可能地备份系统,以免发生意外。如果出现依赖冲突,建议还原系统并使用 2303 版本的方法安装。
安装时,不要直接使用 root 账号操作(使用 sudo 而不是 su),否则可能导致安装的 Windows 软件需要 root 权限才能启动(因为 wine 被安装到了 /root 下)。
本教程受到【ARM版银河麒麟安装windows应用程序】的启发,并参考了部分内容。
一、安装 Box64 和 Box86
请在终端中输入以下命令安装 Box64 和 Box86 。
# Box64
sudo wget https://cdn05042023.gitlink.org.cn/shenmo7192/box64-debs/raw/branch/master/box64-CN.list -O /etc/apt/sources.list.d/box64.list
wget -qO- https://cdn05042023.gitlink.org.cn/shenmo7192/box64-debs/raw/branch/master/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg
sudo apt update
sudo apt install box64 -y# Box86
sudo wget https://cdn05042023.gitlink.org.cn/shenmo7192/box64-debs/raw/branch/master/box64-CN.list -O /etc/apt/sources.list.d/box64.list
wget -qO- https://cdn05042023.gitlink.org.cn/shenmo7192/box64-debs/raw/branch/master/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg
sudo apt update
sudo apt install box64 -y
二、安装 Wine
创建一个 .sh 脚本文件,粘贴并运行以下代码。这段代码修改自 Box 官方文档 。
# NOTE: Can only run on aarch64 (since box64 can only run on aarch64)# box64 runs wine-amd64, box86 runs wine-i386.### User-defined Wine version variables ################# - Replace the variables below with your system's info.# - Note that we need the amd64 version for Box64 even though we're installing it on our ARM processor.# - Note that we need the i386 version for Box86 even though we're installing it on our ARM processor.# - Wine download links from WineHQ: https://dl.winehq.org/wine-builds/branch="staging" #example: devel, staging, or stable (wine-staging 4.5+ requires libfaudio0:i386)version="9.16" #example: "7.1"id="ubuntu" #example: debian, ubuntudist="focal" #example (for debian): bullseye, buster, jessie, wheezy, ${VERSION_CODENAME}, etc tag="-1" #example: -1 (some wine .deb files have -1 tag on the end and some don't)######################################################### Clean up any old wine instanceswineserver -k # stop any old wine installations from runningrm -rf ~/.cache/wine # remove any old wine-mono/wine-gecko install filesrm -rf ~/.local/share/applications/wine # remove any old program shortcuts# Backup any old wine installsrm -rf ~/wine-old 2>/dev/null; mv ~/wine ~/wine-old 2>/dev/nullrm -rf ~/.wine-old 2>/dev/null; mv ~/.wine ~/.wine-old 2>/dev/nullsudo mv /usr/local/bin/wine /usr/local/bin/wine-old 2>/dev/nullsudo mv /usr/local/bin/wine64 /usr/local/bin/wine-old 2>/dev/nullsudo mv /usr/local/bin/wineboot /usr/local/bin/wineboot-old 2>/dev/nullsudo mv /usr/local/bin/winecfg /usr/local/bin/winecfg-old 2>/dev/nullsudo mv /usr/local/bin/wineserver /usr/local/bin/wineserver-old 2>/dev/null# Wine download links from WineHQ: https://dl.winehq.org/wine-builds/# LNKA="https://dl.winehq.org/wine-builds/${id}/dists/${dist}/main/binary-amd64/" #amd64-wine linksLNKA="https://mirrors.tuna.tsinghua.edu.cn/wine-builds/${id}/dists/${dist}/main/binary-amd64/" #amd64-wine linksDEB_A1="wine-${branch}-amd64_${version}~${dist}${tag}_amd64.deb" #wine64 main binDEB_A2="wine-${branch}_${version}~${dist}${tag}_amd64.deb" #wine64 support files (required for wine64 / can work alongside wine_i386 main bin)# DEB_A3="winehq-${branch}_${version}~${dist}${tag}_amd64.deb" #shortcuts & docs# LNKB="https://dl.winehq.org/wine-builds/${id}/dists/${dist}/main/binary-i386/" #i386-wine linksLNKB="https://mirrors.tuna.tsinghua.edu.cn/wine-builds/${id}/dists/${dist}/main/binary-i386/" #i386-wine linksDEB_B1="wine-${branch}-i386_${version}~${dist}${tag}_i386.deb" #wine_i386 main binDEB_B2="wine-${branch}_${version}~${dist}${tag}_i386.deb" #wine_i386 support files (required for wine_i386 if no wine64 / CONFLICTS WITH wine64 support files)# DEB_B3="winehq-${branch}_${version}~${dist}${tag}_i386.deb" #shortcuts & docs# Install amd64-wine (64-bit) alongside i386-wine (32-bit)echo -e "Downloading wine . . ."wget -q ${LNKA}${DEB_A1}wget -q ${LNKA}${DEB_A2}wget -q ${LNKB}${DEB_B1}echo -e "Extracting wine . . ."dpkg-deb -x ${DEB_A1} wine-installerdpkg-deb -x ${DEB_A2} wine-installerdpkg-deb -x ${DEB_B1} wine-installerecho -e "Installing wine . . ."mv wine-installer/opt/wine* ~/wine# Install symlinkssudo rm -f /usr/local/bin/winesudo ln -s ~/wine/bin/wine /usr/local/bin/winesudo rm -f /usr/local/bin/wine64sudo ln -s ~/wine/bin/wine64 /usr/local/bin/wine64sudo rm -f /usr/local/bin/winebootsudo ln -s ~/wine/bin/wineboot /usr/local/bin/winebootsudo rm -f /usr/local/bin/winecfgsudo ln -s ~/wine/bin/winecfg /usr/local/bin/winecfgsudo rm -f /usr/local/bin/wineserversudo ln -s ~/wine/bin/wineserver /usr/local/bin/wineserversudo chmod +x /usr/local/bin/wine /usr/local/bin/wine64 /usr/local/bin/wineboot /usr/local/bin/winecfg /usr/local/bin/wineserver
三、初始化 Wine
使用以下命令对 wine 进行初始化。
wine64 wineboot
你可能会被要求安装 Wine Mono ,该组件允许你运行 .Net 程序,请根据需求安装。
由于无法通过换源解决下载速度问题,可能导致安装时间极长,如有必要请使用代理服务器。注意,如果你在此时在设置中修改了系统代理设置,请重启终端,否则可能导致代理不生效。
如果没有合适的代理服务器,可以在官网下载安装包手动安装。
至此,你的设备已经可以安装和运行 Windows 程序。
wine <可执行文件路径>
由于环境不完整,部分软件可能无法正常运行。
如果你的软件出现了闪退、报错等情况,请根据以下步骤补全环境。
四、安装 Winetricks
使用以下命令安装最新版本的 Winetricks ,更多相关内容请见官方仓库(如自动更新脚本)。
wget https://raw.githubusercontents.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks
sudo mv winetricks /usr/local/bin
如果你需要使用图形界面,还需安装 Zenity 。
sudo apt install zenity
你可能需要安装的字体:
- allfonts
- corefonts
- cjkfonts
你可能需要安装的软件:
- d3dx9
- d3dx10
- d3dx11
- vb6run
- vcrun2022
- riched20
- riched30