ubuntu安装WineHQ(官方教程)

本文档详细介绍了在Ubuntu上安装WineHQ软件包的过程,包括添加存储库密钥、更新包列表、安装稳定版、开发版或实验版Wine,以及解决依赖问题的方法。还提供了离线安装和构建Wow64的指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Ubuntu

Installing WineHQ packages

The WineHQ repository key was changed on 2018-12-19. If you downloaded and added the key before that time, you will need to download and add the new key and run sudo apt update to accept the repository changes.

Beginning with Wine 4.5, the wine-devel packages for Ubuntu 18.04, 18.10, and 19.04 require libfaudio0 as a dependency. Since the distro does not provide it, libfaudio0 packages can be downloaded from the OBS. See https://forum.winehq.org/viewtopic.php?f=8&t=32192 for details

If you have previously installed a Wine package from another repository, please remove it and any packages that depend on it (e.g., wine-mono, wine-gecko, winetricks) before attempting to install the WineHQ packages, as they may cause dependency conflicts.

If your system is 64 bit, enable 32 bit architecture (if you haven't already):

sudo dpkg --add-architecture i386 

Download and add the repository key:

wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key

Add the repository:

For this version: Use this command:
Ubuntu 19.04 sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ disco main'
Ubuntu 18.10 sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ cosmic main'
Ubuntu 18.04

Linux Mint 19.x

sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
Ubuntu 16.04

Linux Mint 18.x

sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'

Update packages:

sudo apt update

Then install one of the following packages:

Stable branch
sudo apt install --install-recommends winehq-stable
Development branch
sudo apt install --install-recommends winehq-devel
Staging branch
sudo apt install --install-recommends winehq-staging

If apt complains about missing dependencies, install them, then repeat the last two steps (update and install).


If you have previously used the distro packages, you will notice some differences in the WineHQ ones:
  • Files are installed to /opt/wine-devel, opt/wine-stable, or /opt/wine-staging (depending on which version you installed).
  • Menu items are not created for Wine's builtin programs (winecfg, etc.), and if you are upgrading from a distro package that had added them, they will be removed. You can recreate them yourself using your menu editor.
  • Binfmt_misc registration is not added. Consult your distro's documentation for update-binfmts if you wish to do this manually.
  • WineHQ does not at present package wine-gecko or wine-mono. When creating a new wine prefix, you will be asked if you want to download those components. For best compatibility, it is recommended to click Yes here. If the download doesn't work for you, please follow the instructions on the Gecko and Mono wiki pages to install them manually.

Installing without Internet

To install Wine on an Ubuntu machine without internet access, you must have access to a second Ubuntu machine (or VM) with an internet connection to download the Wine .deb package and its dependencies.

The procedure goes like this: On the machine with internet, add the WineHQ PPA, then cache just the necessary packages without actually extracting them:

sudo add-apt-repository ppa:wine/wine-builds
sudo apt-get update

Then cache just the packages necessary for installing wine, without extracting them:

sudo apt-get clean
sudo apt-get --download-only install winehq-devel
sudo apt-get --download-only dist-upgrade

Copy all of the .deb files in /var/cache/apt/archives to a USB stick:

cp -R /var/cache/apt/archives/ /media/usb-drive/deb-pkgs/

Finally, on the machine without internet, install all of the packages from the flash drive:

cd /media/usb-drive/deb-pkgs
sudo dpkg -i *.deb

The same instructions can also be used for an offline installation of the `winehq-staging` packages.

Compiling WoW64

Ubuntu's implementation of Multiarch is still incomplete, so for now you can't simply install 32-bit and 64-bit libraries alongside each other. If you're on a 64-bit system, you'll have to create an isolated environment for installing and building with 32-bit dependencies. See Building Biarch Wine On Ubuntu for detailed instructions for Ubuntu using LXC, and Building Wine for general information.

See Also


### 如何在 Ubuntu 18.04 上安装微信 由于微信官方并未提供 Linux 版本的应用程序,因此需要通过其他方式实现其在 Ubuntu 系统上的运行。以下是几种常见的方法及其具体实施步骤。 #### 方法一:使用 Wine 运行 Windows 版本的微信 Wine 是一款能够在 Linux 平台上运行 Windows 应用程序的兼容层软件。此方法适用于希望直接运行 Windows 微信客户端的用户。 1. **确认系统版本** 需要确保当前使用的 Ubuntu 系统版本为 18.04[^3]。 2. **更新系统包管理器索引** ```bash sudo apt update && sudo apt upgrade -y ``` 3. **安装 Wine 和相关依赖项** 执行以下命令以安装最新版 Wine 及必要组件: ```bash sudo dpkg --add-architecture i386 wget -nc https://dl.winehq.org/wine-builds/Release.key sudo apt-key add Release.key echo "deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main" | sudo tee /etc/apt/sources.list.d/winehq-bionic.list sudo apt update sudo apt install wine-stable winetricks ``` 4. **下载并安装 Windows 版本的微信** 前往官方网站或其他可信来源获取 `.exe` 文件,并执行如下命令完成安装过程: ```bash wine weixin_setup.exe ``` 5. **启动应用** 使用 `wine WeChat.exe` 启动已安装好的微信应用程序[^1]。 --- #### 方法二:基于 Deepin-Wine 的解决方案 Deepin-Wine 提供了一种更加优化的方式来支持部分主流 Windows 软件在 Linux 下的运行效果。这种方法特别适合于那些追求更高稳定性和性能表现的场景。 1. 添加 PPA 源至本地配置文件中去: ```bash sudo add-apt-repository ppa:ubuntuppa/ppa sudo apt-get update ``` 2. 接着按照提示输入密码后继续下一步骤即可成功添加仓库信息;随后再执行下面这条语句就可以把 deepin-wine 工具链给装好了哦~ ```bash sudo apt install deepin-wine ``` 3. 获取目标平台专用格式化过的 .tar.gz 或者 deb 类型压缩包形式分发出来的资源链接地址; 4. 解压或者双击打开图形界面下的安装向导对话框之后耐心等待片刻直至结束为止就大功告成啦!最后记得重启一下电脑让所有的更改生效哈😊[^4]. --- #### 方法三:Snap Store 中的一键式方案 (Electronic WeChat) 如果倾向于更简便的方式,则可以考虑通过 Snap 商店部署第三方开发维护的跨平台 Electron 构建版本——即 Electronic WeChat。 只需一条简单的终端指令便可搞定全部事情: ```bash sudo snap install electronic-wechat ``` 调用时也十分方便快捷只需要敲入对应名称就能唤起相应服务窗口显示出来咯😎[^5]. --- ### 注意事项 无论采用哪种途径,在实际操作前都务必做好充分准备功课比如查阅最新的文档资料以及查看社区反馈意见等等从而尽可能减少不必要的麻烦发生几率达到事半功倍的效果最佳实践原则!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ZTao-z

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值