Ubuntu 18.04 安裝wine及windows軟件
安裝wine
# 開啟32位架構(gòu)支持
sudo dpkg --add-architecture i386
# 添加wine軟件源
# 注:最好使用ubuntu默認(rèn)鏡像源,使用阿里云的源會(huì)出現(xiàn)依賴問題
wget -nc https://dl.winehq.org/wine-builds/Release.key
sudo apt-key add Release.key
sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/
sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport
sudo apt update
# 安裝wine,默認(rèn)安裝路徑: /opt/winehq-stable
sudo apt install --install-recommends winehq-stable
# 安裝winetricks
sudo apt install --install-recommends winetricks
# 安裝wine依賴,初始執(zhí)行winecfg或wine或winetricks,軟件會(huì)要求下載安裝 wine-mono 和 wine-gecko
Wine管理Windows軟件
-
安裝
- 官網(wǎng)下載對(duì)應(yīng)軟件安裝包,exe格式
- 右鍵exe安裝包,選擇用wine打開
-
卸載
終端執(zhí)行 wine uninstaller,再彈出的界面中選擇相應(yīng)軟件卸載即可
或者到軟件安裝目錄下找到uninstall.exe,右鍵用wine運(yùn)行
Windows軟件使用問題
中文顯示異常
可將windows相關(guān)目錄下的中文字體文件,如微軟雅黑,仿宋,楷體等文件拷貝到/opt/wine-stable/share/wine/fonts路徑下

image-20210526152904432.png
輸?框不能輸?
輸入框的實(shí)現(xiàn)基本離不開riched20這個(gè)模塊,目前wine上游的riched20模塊還存在很多問題,基本上遇到此類問題直接替換riched20都能解決。
可在終端執(zhí)行 winetricks riched20 ,該命令會(huì)下載W2KSP4_EN和InstMsiW到目錄~/.cache/winetricks/下,若執(zhí)行時(shí)遇到網(wǎng)絡(luò)鏈接異常,可到對(duì)應(yīng)鏈接手動(dòng)下載exe安裝包(鏈接1: W2KSP4_EN.EXE 鏈接2: InstMsiW.EXE),放到~/.cache/winetricks/目錄下的對(duì)應(yīng)文件夾中,再執(zhí)行 winetricks riched20 即可。

image-20210526155658166.png
顯示應(yīng)用程序界面出現(xiàn)重復(fù)圖標(biāo)
wine安裝的windows應(yīng)用程序圖標(biāo)文件在路徑 .local/share/applications/wine/Programs/下,刪除程序重復(fù)的一個(gè).desktop文件,重啟電腦即可。
參考文章
- https://wiki.winehq.org/Download
- https://ubuntuhandbook.org/index.php/2021/02/how-to-install-wine-6-3-in-ubuntu-18-04-20-04-20-10/
- https://docs.qq.com/mind/DWFBpbmpjd0RtV2Z0
- https://bbs.deepin.org/zh/post/174950 (注:不要安裝該文章中的windows相關(guān)依賴,否則可能會(huì)導(dǎo)致ubuntu圖形化界面無法正常啟動(dòng))
- https://zhuanlan.zhihu.com/p/333826060