Ubuntu 20.04.2 LTS 使用 Wine 安装最新版微信 全流程指南 🚀
适用人群:Ubuntu 桌面版用户
目标:在 Ubuntu 20.04.2 LTS 上通过 Wine 环境,安装并运行最新 Windows 版微信客户端
引言
微信 PC 版官方尚未提供 Linux 安装包,但借助 Wine(Windows 兼容层)和 Winetricks,我们依然可以在 Ubuntu 上畅享微信的全部功能。本篇超详细指南,手把手带你从 环境检测、依赖安装、补丁修复,到 微信安装与调试,完全覆盖所有坑点与优化技巧。无论你是 Linux 新手,还是老鸟,这篇文章都能帮你快速完成 Ubuntu 微信环境搭建。
文章目录
一、检测与安装 Wine
1. 查看本机 Wine 版本
打开终端,执行:
wine --version
示例输出(表示已安装 Wine 5.0):
libin@oak:~$ wine --version wine-5.0 (Ubuntu 5.0-3ubuntu1) libin@oak:~$
如果提示 command not found
或版本过低,请继续下面步骤。
2. 安装 Wine 正式版
sudo apt update
sudo apt install wine
安装完成后,再次运行
wine --version
,应看到类似wine-5.0
的输出。
二、安装 Winetricks 并修复 RichEdit
有时微信在 Wine 下无法正确显示输入框内容,需要借助 Winetricks 安装 riched20
补丁。
1. 安装 Winetricks
sudo apt install winetricks
2. 执行 RichEdit 组件安装
winetricks riched20
-
若出现
404
错误,需手动下载以下两个文件到 Winetricks 缓存目录,然后重试:文件名 目标路径 W2KSP4_EN.EXE ~/.cache/winetricks/win2ksp4/W2KSP4_EN.EXE
InstMsiW.exe ~/.cache/winetricks/msls31/InstMsiW.exe
# 下载示例(请根据实际 URL 替换)
wget -O ~/.cache/winetricks/win2ksp4/W2KSP4_EN.EXE https://example.com/W2KSP4_EN.EXE
wget -O ~/.cache/winetricks/msls31/InstMsiW.exe https://example.com/InstMsiW.exe
# 重新执行
winetricks riched20
三、下载并安装微信 PC 客户端
1. 获取微信安装包
前往微信官网,下载 PC 版安装程序 WeChatSetup.exe
:
微信 PC 版下载
2. 运行安装程序
wine WeChatSetup.exe
- 选择默认安装路径,按提示完成安装。
- 安装完成后,可在 Wine 应用菜单或
~/.wine/drive_c/Program Files/Tencent/WeChat
目录下找到 微信 程序。
四、验证与调试
1. 启动微信并查看版本
wine "C:\Program Files\Tencent\WeChat\WeChat.exe"
启动后,在“关于微信”中可查看版本号(示例:
3.4.5.123
)。
2. 系统信息确认
确保你的 Ubuntu 系统版本与本文匹配:
lsb_release -a
示例输出:
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal
五、常见问题与优化
-
输入框不可见
-
确保已正确安装
riched20
:winetricks riched20
-
-
字体渲染模糊
-
安装 Windows 默认字体:
winetricks corefonts
-
-
无法接收声音通知
-
安装音频支持:
winetricks quartz
-
-
微信闪退或 UI 异常
-
尝试切换 Wine Windows 版本:
winecfg # 在“Applications”标签页,将 Windows 版本设置为 Windows 7 或 Windows 10
-
安装日志:
<pre><font color="#4E9A06"><b>libin@oak</b></font>:<font color="#3465A4"><b>~/clash/mysql</b></font>$ sudo apt install winetricks
[sudo] libin 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会同时安装下列软件:
cabextract fuseiso libmspack0
建议安装:
tor unrar-free | unrar
下列【新】软件包将被安装:
cabextract fuseiso libmspack0 winetricks
升级了 0 个软件包,新安装了 4 个软件包,要卸载 0 个软件包,有 3 个软件包未被升级。
需要下载 245 kB 的归档。
解压缩后会消耗 1,323 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libmspack0 amd64 0.10.1-2 [38.0 kB]
获取:2 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 cabextract amd64 1.9-3 [23.4 kB]
获取:3 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 fuseiso amd64 20070708-3.2build1 [19.5 kB]
获取:4 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 winetricks all 0.0+20200412-1 [164 kB]
已下载 245 kB,耗时 2秒 (108 kB/s)<font color="#C4A000"> </font>
正在选中未选择的软件包 libmspack0:amd64。
(正在读取数据库 ... 系统当前共安装有 221476 个文件和目录。)
准备解压 .../libmspack0_0.10.1-2_amd64.deb ...
正在解压 libmspack0:amd64 (0.10.1-2) ...
正在选中未选择的软件包 cabextract。
准备解压 .../cabextract_1.9-3_amd64.deb ...
正在解压 cabextract (1.9-3) ...
正在选中未选择的软件包 fuseiso。
准备解压 .../fuseiso_20070708-3.2build1_amd64.deb ...
正在解压 fuseiso (20070708-3.2build1) ...
正在选中未选择的软件包 winetricks。
准备解压 .../winetricks_0.0+20200412-1_all.deb ...
正在解压 winetricks (0.0+20200412-1) ...
正在设置 libmspack0:amd64 (0.10.1-2) ...
正在设置 fuseiso (20070708-3.2build1) ...
正在设置 winetricks (0.0+20200412-1) ...
正在设置 cabextract (1.9-3) ...
正在处理用于 gnome-menus (3.36.0-1ubuntu1) 的触发器 ...
正在处理用于 libc-bin (2.31-0ubuntu9.2) 的触发器 ...
正在处理用于 man-db (2.9.1-1) 的触发器 ...
正在处理用于 desktop-file-utils (0.24-1ubuntu3) 的触发器 ...
正在处理用于 mime-support (3.64ubuntu1) 的触发器 ...
正在处理用于 hicolor-icon-theme (0.17-2) 的触发器 ...
<font color="#4E9A06"><b>libin@oak</b></font>:<font color="#3465A4"><b>~/clash/mysql</b></font>$ sudo apt install wine
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
wine 已经是最新版 (5.0-3ubuntu1)。
wine 已设置为手动安装。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 3 个软件包未被升级。
<font color="#4E9A06"><b>libin@oak</b></font>:<font color="#3465A4"><b>~/clash/mysql</b></font>$ winetricks riched20
Executing mkdir -p /home/libin
------------------------------------------------------
You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Using winetricks 20200412 - sha256sum: 7651c93e39fcb080483c38836513bf912273a87ea97d137f6b958ed3d9628c3d with wine-5.0 (Ubuntu 5.0-3ubuntu1) and WINEARCH=win64
Executing w_do_call riched20
Executing mkdir -p /home/libin
------------------------------------------------------
You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing load_riched20
Executing mkdir -p /home/libin/.cache/winetricks/win2ksp4
Executing cd /home/libin/.cache/winetricks/win2ksp4
Downloading https://ftp.gnome.org/mirror/archive/ftp.sunet.se/pub/security/vendor/microsoft/win2000/Service_Packs/usa/W2KSP4_EN.EXE to /home/libin/.cache/winetricks/win2ksp4
--2021-10-29 15:32:50-- https://ftp.gnome.org/mirror/archive/ftp.sunet.se/pub/security/vendor/microsoft/win2000/Service_Packs/usa/W2KSP4_EN.EXE
正在连接 127.0.0.1:7890... 已连接。
已发出 Proxy 请求,正在等待回应... 404 Not Found
2021-10-29 15:32:52 错误 404:Not Found。
Executing cd /home/libin/.cache/winetricks/win2ksp4
Downloading https://web.archive.org/web/2000/https://ftp.gnome.org/mirror/archive/ftp.sunet.se/pub/security/vendor/microsoft/win2000/Service_Packs/usa/W2KSP4_EN.EXE to /home/libin/.cache/winetricks/win2ksp4
--2021-10-29 15:32:53-- https://web.archive.org/web/2000/https://ftp.gnome.org/mirror/archive/ftp.sunet.se/pub/security/vendor/microsoft/win2000/Service_Packs/usa/W2KSP4_EN.EXE
正在连接 127.0.0.1:7890... 已连接。
已发出 Proxy 请求,正在等待回应... 302 FOUND
位置:https://web.archive.org/web/20180613014937/https://ftp.gnome.org/mirror/archive/ftp.sunet.se/pub/security/vendor/microsoft/win2000/Service_Packs/usa/W2KSP4_EN.EXE [跟随至新的 URL]
--2021-10-29 15:32:56-- https://web.archive.org/web/20180613014937/https://ftp.gnome.org/mirror/archive/ftp.sunet.se/pub/security/vendor/microsoft/win2000/Service_Packs/usa/W2KSP4_EN.EXE
再次使用存在的到 web.archive.org:443 的连接。
已发出 Proxy 请求,正在等待回应... 302 Found
位置:https://web.archive.org/web/20180613014937/https://saimei.ftp.acc.umu.se/mirror/archive/ftp.sunet.se/pub/security/vendor/microsoft/win2000/Service_Packs/usa/W2KSP4_EN.EXE [跟随至新的 URL]
--2021-10-29 15:32:56-- https://web.archive.org/web/20180613014937/https://saimei.ftp.acc.umu.se/mirror/archive/ftp.sunet.se/pub/security/vendor/microsoft/win2000/Service_Packs/usa/W2KSP4_EN.EXE
再次使用存在的到 web.archive.org:443 的连接。
已发出 Proxy 请求,正在等待回应... 302 FOUND
位置:https://web.archive.org/web/20180613014941/https://saimei.ftp.acc.umu.se/mirror/archive/ftp.sunet.se/pub/security/vendor/microsoft/win2000/Service_Packs/usa/W2KSP4_EN.EXE [跟随至新的 URL]
--2021-10-29 15:32:57-- https://web.archive.org/web/20180613014941/https://saimei.ftp.acc.umu.se/mirror/archive/ftp.sunet.se/pub/security/vendor/microsoft/win2000/Service_Packs/usa/W2KSP4_EN.EXE
再次使用存在的到 web.archive.org:443 的连接。
已发出 Proxy 请求,正在等待回应... 200 OK
长度: 未指定 [application/x-msdownload]
正在保存至: “W2KSP4_EN.EXE”
W2KSP4_EN.EXE [ <=> ] 129.20M 564KB/s 用时 3m 23s
2021-10-29 15:36:21 (652 KB/s) - “W2KSP4_EN.EXE” 已保存 [135477136]
Executing cd /home/libin/clash/mysql
Executing cabextract -q -d /home/libin/.wine/dosdevices/c:/windows/temp -L -F i386/riched20.dl_ /home/libin/.cache/winetricks/win2ksp4/W2KSP4_EN.EXE
Executing cabextract -q --directory=/home/libin/.wine/dosdevices/c:/windows/syswow64 /home/libin/.wine/dosdevices/c:/windows/temp/i386/riched20.dl_
Using native,builtin override for following DLLs: riched20
Executing wine regedit C:\windows\Temp\override-dll.reg
Executing wine64 regedit C:\windows\Temp\override-dll.reg
Executing w_do_call msls31
Executing mkdir -p /home/libin
------------------------------------------------------
You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing load_msls31
Executing mkdir -p /home/libin/.cache/winetricks/msls31
Executing cd /home/libin/.cache/winetricks/msls31
Downloading https://ftp.hp.com/pub/softlib/software/msi/InstMsiW.exe to /home/libin/.cache/winetricks/msls31
--2021-10-29 15:36:24-- https://ftp.hp.com/pub/softlib/software/msi/InstMsiW.exe
正在连接 127.0.0.1:7890... 已连接。
已发出 Proxy 请求,正在等待回应... 301 Moved Permanently
位置:https://ftp.ext.hp.com/pub/softlib/software/msi/InstMsiW.exe [跟随至新的 URL]
--2021-10-29 15:36:26-- https://ftp.ext.hp.com/pub/softlib/software/msi/InstMsiW.exe
正在连接 127.0.0.1:7890... 已连接。
已发出 Proxy 请求,正在等待回应... 404 Not Found
2021-10-29 15:36:27 错误 404:Not Found。
Executing cd /home/libin/.cache/winetricks/msls31
Downloading https://web.archive.org/web/2000/https://ftp.hp.com/pub/softlib/software/msi/InstMsiW.exe to /home/libin/.cache/winetricks/msls31
--2021-10-29 15:36:27-- https://web.archive.org/web/2000/https://ftp.hp.com/pub/softlib/software/msi/InstMsiW.exe
正在连接 127.0.0.1:7890... 已连接。
已发出 Proxy 请求,正在等待回应... 302 FOUND
位置:https://web.archive.org/web/20180612201004/http://ftp.hp.com/pub/softlib/software/msi/InstMsiW.exe [跟随至新的 URL]
--2021-10-29 15:36:28-- https://web.archive.org/web/20180612201004/http://ftp.hp.com/pub/softlib/software/msi/InstMsiW.exe
再次使用存在的到 web.archive.org:443 的连接。
已发出 Proxy 请求,正在等待回应... 301 Moved Permanently
位置:https://web.archive.org/web/20180612201004/http://whp-aus2.cold.extweb.hp.com/pub/softlib/software/msi/InstMsiW.exe [跟随至新的 URL]
--2021-10-29 15:36:29-- https://web.archive.org/web/20180612201004/http://whp-aus2.cold.extweb.hp.com/pub/softlib/software/msi/InstMsiW.exe
再次使用存在的到 web.archive.org:443 的连接。
已发出 Proxy 请求,正在等待回应... 302 FOUND
位置:https://web.archive.org/web/20180612201007/http://whp-aus2.cold.extweb.hp.com/pub/softlib/software/msi/InstMsiW.exe [跟随至新的 URL]
--2021-10-29 15:36:29-- https://web.archive.org/web/20180612201007/http://whp-aus2.cold.extweb.hp.com/pub/softlib/software/msi/InstMsiW.exe
再次使用存在的到 web.archive.org:443 的连接。
已发出 Proxy 请求,正在等待回应... 200 OK
长度: 未指定 [application/octet-stream]
正在保存至: “InstMsiW.exe”
InstMsiW.exe [ <=> ] 1.74M 636KB/s 用时 2.8s
2021-10-29 15:36:33 (636 KB/s) - “InstMsiW.exe” 已保存 [1822848]
Executing cd /home/libin/clash/mysql
Executing cabextract -q --directory=/home/libin/.wine/dosdevices/c:/windows/temp /home/libin/.cache/winetricks/msls31/InstMsiW.exe
Executing cp -f /home/libin/.wine/dosdevices/c:/windows/temp/msls31.dll /home/libin/.wine/dosdevices/c:/windows/syswow64
<font color="#4E9A06"><b>libin@oak</b></font>:<font color="#3465A4"><b>~/clash/mysql</b></font>$ winetricks riched20
Executing mkdir -p /home/libin
------------------------------------------------------
You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Using winetricks 20200412 - sha256sum: 7651c93e39fcb080483c38836513bf912273a87ea97d137f6b958ed3d9628c3d with wine-5.0 (Ubuntu 5.0-3ubuntu1) and WINEARCH=win64
Executing w_do_call riched20
Executing mkdir -p /home/libin
------------------------------------------------------
You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
riched20 already installed, skipping
<font color="#4E9A06"><b>libin@oak</b></font>:<font color="#3465A4"><b>~/clash/mysql</b></font>$
</pre>
解决问题
若出现中文显示未乱码方块的问题,解决方式如下
Windows 支持字体链接:当一种字体中不存在某个字时,可以尝试从另一个字体文件中寻找相应的字形。所以只要把当前系统中的中文字体设为"fallback"字体,汉字通常就能正确显示了。方法也很简单,只需创建一个文本文件 chn_font.reg,内容如下:
REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]
“Lucida Sans Unicode”=“wqy-microhei.ttc”
“Microsoft Sans Serif”=“wqy-microhei.ttc”
“MS Sans Serif”=“wqy-microhei.ttc”
“Tahoma”=“wqy-microhei.ttc”
“Tahoma Bold”=“wqy-microhei.ttc”
“SimSun”=“wqy-microhei.ttc”
“Arial”=“wqy-microhei.ttc”
“Arial Black”=“wqy-microhei.ttc”
regedit chn_font.reg
————————————————
六、总结
通过以上步骤,你已在 Ubuntu 20.04.2 LTS 上成功搭建微信 PC 版运行环境:
- 检测并安装 Wine
- 安装 Winetricks 并修复 RichEdit
- 下载并执行 WeChat 安装包
- 验证版本并做基础优化
希望这篇超详细全流程指南,能让你在 Linux 世界中也能畅快使用微信。如有更多问题,欢迎留言讨论!🎉