如何在 Debian 11|10|9 上安装 Wine 8
本指南将介绍在 Debian 11|10|9 工作站上安装 Wine。 Wine 是一款开源软件,允许您在 Linux 上运行 Microsoft Windows 应用程序。通过利用其 Winelib 库,您可以编译 Windows 应用程序以帮助将它们移植到类 Unix 系统。
如果您想了解 Wine 8 中的新功能,请查看 Wine 8 版本和新功能文章。本文将讨论在 Debian 11|10|9 上轻松安装 Wine。
第 1 步:启用 32 位架构
如果您运行的是 64 位系统,请启用对 32 位应用程序的支持。
sudo dpkg --add-architecture i386
上面的命令不会返回任何输出。
第2步:添加WineHQ存储库
我们将从手动添加的 WineHQ 存储库中提取最新的 Wine 包。
首先,导入GPG密钥:
sudo apt update
sudo apt -y install gnupg2 software-properties-common
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
您应该在输出中收到“OK”。
通过运行以下命令添加 Wine 存储库:
sudo apt-add-repository https://dl.winehq.org/wine-builds/debian/
该命令会将存储库添加到行 /etc/apt/sources.list 文件中。
之后更新 APT 包索引:
sudo apt update
使用OBS存储库(替代)
您也可以使用OBS存储库代替官方存储库。添加Wine OBS存储库,如下所示:
Debian 11:
wget -O- -q https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_11/Release.key | sudo apt-key add -
echo "deb http://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_11 ./" | sudo tee /etc/apt/sources.list.d/wine-obs.list
Debian 10:
wget -O- -q https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10/Release.key | sudo apt-key add -
echo "deb http://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10 ./" | sudo tee /etc/apt/sources.list.d/wine-obs.list
Debian 9:
wget -O- -q https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_9.0/Release.key | sudo apt-key add -
echo "deb http://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_9.0 ./" | sudo tee /etc/apt/sources.list.d/wine-obs.list
步骤 3:在 Debian 11|10|9 上安装 Wine
配置完 APT 存储库后,最后一步是在 Debian 上实际安装 Wine。
然后从稳定分支安装 Wine:
sudo apt update
sudo apt install --install-recommends winehq-stable
安装后。验证安装的版本。
$ wine --version
wine-8.0
第 4 步:在 Debian 上使用 Wine
有关 wine 的基本用法,请查看帮助页面。
$ wine --help
下面的示例用于在 Linux 上运行 Notepad++ 编辑器。
cd ~/Downloads
VER=$(curl -s https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/releases/latest | grep tag_name | cut -d '"' -f 4 | sed 's/v//g')
wget https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v${VER}/npp.${VER}.Installer.exe
wine ./npp.${VER}.Installer.exe
按照安装提示进行操作,就像安装任何其他 Windows 应用程序一样。
感谢您参考我们关于如何在 Debian 上安装 Wine 的文章。
其他指南。
- 如何在 Debian 上安装 Google Chrome 网络浏览器
- 如何在 Debian 上安装 PostgreSQL
- Bind、dnsmasq、PowerDNS、Unbound