Installation and use of Wine under Ubuntu (taking 22.04 as an example)

Install

  1. Verify if it is a 64-bit architecture
dpkg --print-architecture
  • returnamd64
  1. Check if 32-bit architecture is installed
dpkg --print-foreign-architectures
  1. If displayedi386, skip this step, otherwise execute
sudo dpkg --add-architecture i386
  1. double check
dpkg --print-foreign-architectures
  1. Download and add the WineHQ repository key
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
  1. Select the sources files you need to use as needed

    1. Use official sources
    sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
    
    1. Use the domestic source code to edit the file/etc/apt/sources.list.d/winehq-jammy.sources and write the following content in the file
    Types: deb
    URIs: https://mirrors.tuna.tsinghua.edu.cn/wine-builds/ubuntu
    Suites: jammy
    Components: main
    Architectures: amd64 i386
    Signed-By: /etc/apt/keyrings/winehq-archive.key
    

    Other versions are expected to modify the Suites and .sources fields of the jammy file name. Please refer to the version code below. Figure
    sources

  2. Update database

sudo apt update
  1. Install Wine
sudo apt install winehq-stable      # 安装稳定版(推荐)
sudo apt install winehq-devel       # 安装开发版
sudo apt install winehq-staging     # 安装暂存版(开发版的开发版,不知道怎么翻译比较合适)

Instructions

  1. Place the Windows program in any directory and enter the directory in the terminal
  2. ExecutewineInstall or use any Windows program
wine xxxx.exe
  1. Manual use or installation Programs that require the .NET Framework will be installed automaticallyWine Mono
    mono

Frequently Asked Questions

  • Missing fonts or incorrect layout

    1. Find a win computer, findC:/Windows/fonts/, right-click the sort method type, copy the .ttf and .ttc files to linux Download and enter the directory.
    2. Copy the ttf and ttc files to the /usr/share/fonts/ folder under Linux.
      The font cannot be found because the ttf is incomplete
      sudo cp ./*.ttf /usr/share/fonts/
      
      The paragraph format is disordered because the ttc is incomplete
      sudo cp ./*.ttc /usr/share/fonts/
      
    3. Generate font index information:
      sudo mkfontscale
      sudo mkfontdir
      
    4. Update font cache:
      sudo fc-cache
      
  • The problem of garbled Chinese interface when the system default language is not Chinese can be solved through

    env LANG=zh_CN.UTF-8 wine xxxx.exe
    

    Run the corresponding program to solve the problem

  • The COM port corresponding to USB to serial port can be viewed through the command in ~/.wine/dosdevices. The following serial port uses COM33: ll
    tty

  • The USB to serial port cannot be opened. The serial port permissions need to be configured. Udev processing can be configured. The specific operation process is as follows:

    1. Create a rules file in/etc/udev/rules.d (skip this step if you want to write to an existing rules file)
    sudo gedit /etc/udev/rules.d/70-persistent-usb.rules
    
    1. Add the following content to the file
    KERNEL=="ttyUSB[0-20]*",MODE="0666"
    
    1. Reload udev service
    sudo service udev reload
    
    1. Restart udev service
    sudo service udev restart
    

Reference connection:
[1]. https://wine.htmlvalidator.com/install-wine-on-ubuntu-22.04.html
[2]. http://www.zztongyun.com/article/yum%E6%9B%B4%E6%8D%A2%E5%9B%BD%E5%86%85%E6%BA%90

Guess you like

Origin blog.csdn.net/plokm789456/article/details/130210571