Как запустить wine в ubuntu
Перейти к содержимому

Как запустить wine в ubuntu

  • автор:

How to Install Wine in Ubuntu 22.04 to Install & Run Windows Apps

To run Microsoft Windows applications in Ubuntu Linux, Wine or CrossOver (paid version) is a good choice. And here’s how to install and use Wine in Ubuntu 22.04 LTS.

In this tutorial, you’ll see 2 ways to install Wine in Ubuntu. Choose either one that you prefer.

Install Wine from Ubuntu repository:

Ubuntu included Wine package in its own repository, though it’s old. User may simply press Ctrl+Alt+T on keyboard to open terminal and run command to install it:

sudo dpkg --add-architecture i386 && sudo apt install wine

Type user password (no asterisk feedback) and hit Enter to authentication for sudo.

After installed package run winecfg in terminal to generate configuration file. And, run command to make link the .desktop file:

sudo ln -s /usr/share/doc/wine/examples/wine.desktop /usr/share/applications/

Finally, you may right-click on an EXE file to run via “Wine Windows Program Loader” option:

Install Wine from its official repository:

The Wine developer team provides an official apt repository for Debian/Ubuntu based systems. By releasing v7.6, it added Ubuntu 22.04 support.

1. Install Wine key

The repository now has updated with new method to install the key to follow Debian policy, as apt-key is deprecated. However, it’s still ASCII-armored key so far.

Press Ctrl+Alt+T on keyboard to open terminal. When it opens, create the directory for storing the keys:

sudo mkdir -p /etc/apt/keyrings

Then, run the single command to download the key, dearmor, and move to “/etc/apt/keyrings” directory:

wget -O - https://dl.winehq.org/wine-builds/winehq.key | gpg --dearmor | sudo tee /etc/apt/keyrings/winehq-archive.key

Type user password and hit Enter if the command stuck with blinking cursor. And, it will output un-readable text as the picture shows:

2. Add Wine repository:

Next run the commands below one by one to download the repository setup file and move to “/etc/apt/sources.list.d” directory.

    Download the source file:

wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -sc)/winehq-$(lsb_release -sc).sources
sudo mv winehq-$(lsb_release -sc).sources /etc/apt/sources.list.d/

NOTE: This command is for Ubuntu only. “$(lsb_release -sc)” returns system’s code-name. For Linux Mint and other Ubuntu based system, replace it with jammy (22.04), focal (20.04) or bionic (18.04) depends on which Ubuntu edition your system is based on.

3. Update cache

Before installing any package from that repository, you need to refresh system cache by running command in terminal:

sudo apt update
4. Install Wine:

The Wine repository provides three Wine packages:

  • winehq-stable – the stable version (v8.0 so far)
  • winehq-devel – the latest development release.
  • winehq-staging – the testing version with patches applied on top of the corresponding wine-devel

Select install one of the packages by running command below in terminal:

    To install the stable edition use command:

sudo apt install winehq-stable
sudo apt install winehq-devel
sudo apt install winehq-staging

NOTE: It does not re-build old packages for new Linux systems. winehq-stable so far is not available for Ubuntu 22.04, since the new LTS is released after wine stable 7.0. User may wait for the next stable release (v7.0.1 or v8.0).

After installation, right-click on your EXE file and start it via Wine program loader option. See if your app works with wine.

How to Remove Wine:

1. To remove the Wine package, simply open terminal and run commands:

sudo apt remove wine winehq-stable winehq-staging winehq-devel

There will be local configuration files and app data left under .wine and .local/share/applications. They are hidden folders, press Ctrl+H in file manager to toggle display and remove them as you want.

2. To remove the Wine repository, open terminal (Ctrl+Alt+T) and run command:

sudo rm /etc/apt/sources.list.d/winehq-*.sources

And remove the repository key via command:

sudo rm /etc/apt/keyrings/winehq-archive.key

Finally apply changes by running sudo apt update to refresh system package cache.

permalink

Ji m

I’m a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to remind me outdated tutorial! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1

  • Ubuntu 22.04 Finally Supports.
  • How to Remove Snap Apps &.

11 responses to How to Install Wine in Ubuntu 22.04 to Install & Run Windows Apps

I have followed the steps above in Ubuntu 22.04 to install wine.
It does not open but gives me an error message….
Couldn’t load XPCOM. What do I do next?

Well I followed the second option and it was so cool and easy. I’m currently using Linux Lite 6.4 (Ubuntu Based distro).
Thank you very much, won’t be stressing myself so much the next time I will be installing winehq.

JeanMichelFelur April 15, 2023 at 5:33 pm

Your command: wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -sc)/winehq-$(lsb_release -sc).sources does NOT work andproduces this message: zsh: parse error near `)’ The correct command WORKS OK for Ubuntu 22.04 LTS: wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources You should see something like this: Resolving dl.winehq.org (dl.winehq.org)… 146.75.94.217
Connecting to dl.winehq.org (dl.winehq.org)|146.75.94.217|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 163
Saving to: ‘winehq-jammy.sources’ winehq-jammy. 100% 163 –.-KB/s in 0s 2023-04-15 11:26:25 (9.73 MB/s) – ‘winehq-jammy.sources’ saved [163/163]

I installed WINE via the first method. Seemed to go fine. But when I get to the step about trying to run an executable file, WINE is nowhere to be found in any of my menus. I assumed the command before that step was meant to create a desktop icon, but it didn’t. Rebooted the machine and still nothing. Wine is installed on the system – I checked via two methods. But no idea how to launch it. Apparently from command line I can enter “wine” and then the name of a program, but I don’t have a program, i have an .exe file in my downloads folder that I want to run. Any idea where I can find Wine or why it’s not showing up?

Did you try to generate config file via command:

winecfg

Also, create the shortcut by linking the example file:

sudo ln -s /usr/share/doc/wine/examples/wine.desktop /usr/share/applications/

This worked in my case in Ubuntu 22.04.

Yes, I did both those things. I’ve decided to give up on WINE and try VirtualBox instead as it seems like WINE is pretty consistently riddled with problems. I’m not the only one who has this install issue and there don’t seem to be any easy fixes. Thanks anyway.

apt-get check` failed, you may have broken packages. Aborting…
Got all the way only to get this at the end. Any ideas?
Ubuntu 22.04.2 LTS fully updated.

Could you please paste the error output here, from terminal window. So we can tell what was going wrong.

Jim Rodgers May 31, 2023 at 3:39 pm

There is no error. What I am seeing is that my version of the iso file does not include the partition table you show in your installation guide (even though my copy came from the “Official Ubuntu” site.) Do you have a recommended site to download the iso file from (My experience with PhoenixNAP was that is is VERY slow).
Thank you

Установка Wine

Wine – приложение, являющееся слоем совместимости с Windows API , использующее библиотеки Windows для обеспечения работоспособности приложений, разработанных для ОС семейства Microsoft Windows в иной среде, например, в Ubuntu. Используя Wine, вы можете устанавливать и запускать различные программы так, как будто вы используете Windows.
Wine активно развивается. Ещё не все приложения достаточно стабильно работают в Wine, однако Wine уже используется несколькими миллионами пользователей по всему миру.
Название программы Wine (waɪn — между «уа́йн» и «ва́йн», рус. Вино) — рекурсивный акроним фразы «Wine Is Not an Emulator» — рус. «Wine — не эмулятор».

Установка Wine

Установка из PPA

В связи с тем, что Wine активно развивается, в репозиториях Ubuntu обычно содержится очень старая версия. Поэтому рекомендуется ставить последнюю версию из официального репозитория Wine.

Для последних версий wine и ubuntu 64 бита

sudo dpkg --add-architecture i386 sudo add-apt-repository ppa:wine/wine-builds && sudo apt-get update sudo apt-get install --install-recommends winehq-devel

И вообще не рекомендуется заполнять и настраивать wine самому. Работать с wine не совсем удобно. Чтобы установить ту или иную программу придется облазить кучу форумов и блогов, чтобы понять какие пакеты нужно установить и какие библиотеки добавить. Затем следует длинный процесс решения проблем, установки пакетов через winetricks и ручной настройки реестра и так далее. Это все очень сложно даже для опытных пользователей, не говоря уже про новичков. Поэтому рекомендуется скачать настроенный префикс wine отсюда : http://forum.ubuntu.ru/index.php?topic=199897.0

Настройка

Перед использованием Wine для запуска приложений нужно запустить программу настройки, которая создаст в вашей домашней директории каталог ~/.wine с необходимыми для работы файлами. Для этого либо выберите пункт главного меню Приложения→Wine→Configure Wine, либо выполните в терминале команду:

winecfg

Ассоциирование файлов с программами wine

Чтобы прозрачно запускать файлы с помощью wine-программ, напишем небольшой скрипт. Допустим, нам надо открывать CAD-файлы Компасом и zwcad’ом.

#!/bin/bash # Определяем расширение файла dd=$1; razr=`echo $ ;` ff=`echo $`; ff=`echo "\"Z:"$ff\"`; # В зависимости от расширение запускаем нужную программу case $razr in frw) env WINEPREFIX="/home/"$USER"/.wine" wine start "C:\\Program Files\\ASCON\\KOMPAS-3D Viewer V9\\Bin\\kViewer.Exe" `echo $ff` & ;; cdw) env WINEPREFIX="/home/"$USER"/.wine" wine start "C:\\Program Files\\ASCON\\KOMPAS-3D Viewer V9\\Bin\\kViewer.Exe" `echo $ff` & ;; dwg) env WINEPREFIX="/home/"$USER"/.wine" wine start "C:\\Program Files\\ZWCAD 2009 Eng\\ZWCAD.exe" `echo $ff` & ;; dxf) env WINEPREFIX="/home/"$USER"/.wine" wine start "C:\\Program Files\\ZWCAD 2009 Eng\\ZWCAD.exe" `echo $ff` & ;; # Тут можно добавить ещё расширений и программ esac

Не забудем сделать наш скрипт исполняемым

chmod +x wine_cad.sh

и ассоциируем в файловом менеджере чертежи со скриптом.

Запуск Windows приложений

Для того, что бы запустить приложение вам нужно открыть терминал и прописать в нем:

wine путь/к приложению/program.exe

Если у вас не запускается приложение или работает неправильно На сайте wine есть список приложений с описанием, для начала рекомендую свериться с ним. http://appdb.winehq.org/ — На сайте есть поле поиска. Если у вас плохо с английским, то используйте переводчик http://translate.google.com/.

Также можно открыть папку с приложением, которое вам необходимо запустить при помощи файлового менеджера, затем щелкнуть правой кнопкой мыши по приложению и выбрать программу для запуска — Wine.

Приложениям, запущенным через Wine, которые работают с Веб-страницами необходим Gecko

Gecko – это свободный движок вывода веб-страниц для браузера при работе в интернете wine. Если wine не работает с интернетом и вы не запускаете windows exe браузер, то вам Gecko не нужен .Обычно при запуске приложения для работы с веб-страницами Wine автоматически ищет Gecko сперва в /usr/share/wine/gecko. Если Wine не находит архив с Gecko там, то оно автоматически загружает его из интернета, но некоторые приложения не любят ждать, пока загрузиться Gecko и зависают или вылетают. Gecko можно установить выполнив команду:

sudo apt-get install wine-geckoверсия>

где надо заменить на версию установленного Wine.

Запуск через дискретную видеокарту

Для запуска через дискретную видеокарту надо прописать в терминале на свободных драйверах( или написать скрипт)

vblank_mode=0 DRI_PRIME=1 wine имя_файла.exe

vblank_mode=0 означает вертикальная синхронизация(Vsync). Если в настройках игры нет VSync, то необходимо стереть vblank_mode=0

Сохранить. Поместить в папку с игрой. Сделать исполняемым в свойствах. Поместить ссылку на скрипт на рабочий стол. Запускать ссылку вместо файла игры. Для ещё большей производительности необходимо поставить закрытый поприетарный драйвер.

Winetricks

Winetricks – это скрипт для установки различных компонентов от Microsoft®, и некоторых других. Для получения Winetricks в терминале введите:

sudo apt-get install winetricks

. Winetricks содержит несколько десятков пакетов различных библиотек для wine. Например, чтобы установить DirectX™, введите:

winetricks d3dx9

Для просмотра списка всех пакетов, введите:

winetricks ?

Также, Winetricks имеет простой GUI . Для его запуска введите:

Как установить и использовать Wine в Ubuntu 20.04

Wine — это уровень совместимости с открытым исходным кодом, который позволяет запускать приложения Windows в Unix-подобных операционных системах, таких как Linux, FreeBSD и macOS. Wine — это аббревиатура от «Wine Is Not an Emulator». Он преобразует системные вызовы Windows в эквивалентные вызовы POSIX, используемые операционными системами на основе Unix, что позволяет легко интегрировать программы Windows в среду рабочего стола.

Не все приложения Windows будут работать в Wine, и даже если они это сделают, они могут вести себя не так, как обычно. Wine AppDB представляет собой базу данных , содержащую список приложений, которые были проверены и подтверждены на работу под Wine.

Wine не всегда лучший вариант для запуска программ Windows в Linux. Вы также можете использовать инструмент виртуализации, такой как VirtualBox или VMware, но они требуют больше системных ресурсов и установочного файла Windows.

В этой статье описывается, как установить Wine на Ubuntu 20.04. Мы покажем вам, как установить дистрибутив по умолчанию версии 5.0 и последней версии 6.x из репозиториев WineHQ. Те же инструкции применимы для любого дистрибутива на основе Ubuntu, включая Zorin OS, Linux Mint и Elementary OS.

Установка Wine 5.0 на Ubuntu

Пакеты Wine включены в репозитории Ubuntu по умолчанию и могут быть легко установлены с помощью aptдиспетчера пакетов. Это самый простой способ установить Wine на Ubuntu. Однако версия дистрибутива может отставать от последней версии Wine.

Большинство приложений Windows созданы для 32-битной архитектуры. Первый шаг — включить мультиархитектуру, которая позволяет устанавливать на машину как 64-битные, так и 32-битные пакеты:

sudo dpkg --add-architecture i386 sudo apt update
sudo apt install wine64 wine32

После завершения установки проверьте это, распечатав версию Wine:

wine --version

Текущая версия Wine, доступная в репозиториях Ubuntu 20.04, — это 5.0.

wine-5.0 (Ubuntu 5.0-3ubuntu1)

Вот и все. Wine установлен на ваш компьютер, и вы можете начать его использовать.

Установка Wine 6.0 на Ubuntu

В этом разделе мы предоставим пошаговые инструкции о том, как установить Wine версии 6 на Ubuntu 20.04.

Если вы используете 64-битную систему Ubuntu, включите 32-битную архитектуру и обновите список пакетов:

sudo dpkg --add-architecture i386 sudo apt update

Импортируйте GPG-ключ репозитория WineHQ:

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

Добавьте репозиторий WineHQ в вашу систему:

sudo apt install software-properties-common sudo apt-add-repository "deb http://dl.winehq.org/wine-builds/ubuntu/ $(lsb_release -cs) main"

Установите Wine, набрав:

sudo apt install --install-recommends winehq-stable

Это установит кучу пакетов. После завершения проверьте установку Wine, набрав:

wine --version

На момент написания этой статьи последней основной версией Wine была версия 6.0:

wine-6.0

Wine установлен и готов к использованию.

Настройка Wine

Чтобы начать настройку Wine, запустите команду winecfg в своем терминале. Команда устанавливает Mono и Gecko и устанавливает среду Wine:

winecfg

Появится диалоговое окно с вопросом, хотите ли вы установить пакет wine-mono:

Нажмите кнопку «Установить», и установка начнется. После этого появится новый диалог, предлагающий установить Gecko. Снова нажмите кнопку «Установить».

Когда установка будет завершена, отобразится диалоговое окно конфигурации Wine. Здесь вы можете настроить различные параметры Wine. В большинстве случаев достаточно настроек по умолчанию. По завершении закройте диалоговое окно.

Установка Notepad ++ в Ubuntu

Теперь, когда Wine установлен и настроен, мы объясним, как устанавливать приложения Windows на вашу Ubuntu.

В этом руководстве мы покажем вам, как установить Notepad ++, один из самых популярных текстовых редакторов Windows. Запустите браузер и загрузите установочный файл со страницы загрузки Notepad ++.

После завершения загрузки запустите установку, щелкнув .exe файл правой кнопкой мыши и выбрав «Открыть с помощью Wine Windows Program Loader».

Мастер установки запустится, выберет язык и установит Notepad ++ так же, как и любое приложение на компьютере с Windows.

Приложения Windows устанавливаются в каталог ~/.wine/drive_c/ .

Чтобы запустить редактор Notepad ++, перейдите в каталог ~/.wine/drive_c/Program Files (x86)/Notepad++ и дважды щелкните файл notepad++.exe .

Вы также можете запустить приложение из панели поиска действий.

Заключение

Мы показали вам, как установить Wine на рабочий стол Ubuntu 20.04 и как устанавливать приложения Windows.

Если вы столкнулись с проблемой или хотите оставить отзыв, оставьте комментарий ниже.

Насколько публикация полезна?

Нажмите на звезду, чтобы оценить!

Средняя оценка / 5. Количество оценок:

Оценок пока нет. Поставьте оценку первым.

How to Install Wine on Ubuntu 22.04 LTS

Wine Windows Emulator on Ubuntu 22.04

Wine Windows Emulator on Ubuntu 22.04

When Linux was originally made public, it lacked many useful applications that the major competitor Windows successfully supported. Linux thus created a compatibility layer, called Wine, which was used to run the Windows applications on Linux itself. Initially, Wine could only run a few Windows applications but now it can support thousands of them; making it a compelling Linux application. Its installation, however, is very simple!

This article describes installing Wine on an Ubuntu 22.04 system. We have described the installation only through the command line.

Installing Wine On Ubuntu

Step1: Check if you have an Ubuntu 32-bit or 64-bit system

There are different versions of Wine available for 32-bit and 64-bit flavors of Ubuntu. In order to check which version you are using so that you can install the appropriate version of wine, please follow these steps:

Open the Terminal either through Ubuntu Dash or the Ctrl+Alt+T shortcut.

Use the following command to fetch CPU details from the files sysfs and /proc/cpuinfo:

$ lscpu

This command will display the following output:

Ubuntu CPU Architecture

The CPU op-mode(s) entry tells you about the flavor of Ubuntu you are running on your system; 32-bit means you are running a 32-bit Linux OS, 32-bit, 64-bit signifies that you are running a 64-bit OS.

Step2: Installing Wine from a Standard Ubuntu Repository (recommended)

We recommend that you install Wine on your system through the standard Ubuntu repository, as this way you can have a more stable version on your system.

Run the following command in the Terminal as a root user in order to install Wine on a 64-bit version of Ubuntu:

$ sudo apt install wine64

Installing Wine Windows Emulator on Ubuntu 22.04

Please enter y when you are prompted with a y/n option for installation. After that, the Wine application will be installed and ready for use.

For a 32-bit Ubuntu system, you can use the following command:

$ sudo apt install wine32

You can verify the version of Wine through the following command:

$ wine --version

Alternative: Installing Wine from the WineHQ Repository

The WineHQ repository has a set of standard Wine packages that you can download and install on your system. Please follow these steps to do so:

Run the following command in the Terminal for adding i386 architecture before installing a 64-bit version of Wine:

$ sudo dpkg --add-architecture i386

Add i386 architecture

Run the following commands in order to add the WineHQ signing key:

$ cd /tmp $ wget -nc https://dl.winehq.org/wine-builds/winehq.key $ sudo mv winehq.key /usr/share/keyrings/winehq-archive.key

Download and Install the WineHQ repository key

Tip: You can copy this command from this tutorial instead of typing it in the Terminal. Select and copy this command from here, right-click in the Terminal prompt and then select Paste from the menu.

Now run the following command in order to add the WineHQ repository:

$ wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources $ sudo mv winehq-jammy.sources /etc/apt/sources.list.d/

Add the WineHQ Repository

Then update the Ubuntu package lists with the command:

apt update

Update package lists

Here you have two options about which release of Wine you want to install; the stable version or the development version.

  • WineHQ Stable: This is the most recent and stable release of Wine available. Use the following command to install this version:
sudo apt install --install-recommends winehq-stable

Please enter Y when prompted with a choice of y/n for installation. After that, the stable version of Wine will be installed on your system.

At the time of writing this guide, there is no stable version of Wine available yet, so executing the command will result in the error message:

E: Unable to locate package winehq-stable

For this reason, I will install the Development branch now. But generally, I recommend using the stable branch.

  • WineHQ Development: This is the most recent version of Wine but it might not be very stable. As a developer, you might be more interested in installing this version.
sudo apt-get install --install-recommends winehq-devel

Install Wine Development version

Please enter Y when prompted with a choice of y/n for installation. After that, the development version of Wine will be installed on your system.

In order to verify installation and check which version is installed on your system, run the following command:

$ wine --version

Wine version 7 installed

Uninstalling Wine From Your System

Please enter the following command in your Ubuntu Terminal in order to uninstall Wine from your system:

$ sudo apt-get purge winehq-stable

You will also need to remove the following folders manually:

~/.config/wine/ -r $HOME/.wine $HOME/.config/menus/applications-merged/wine* $HOME/.local/share/applications/wine /.local/share/desktop-directories/wine* /.local/share/icons/. _*.xpm

The installation will now be completely removed from your system.

Conclusion

By following the steps described in this tutorial, you will be successfully able to install the useful application Wine to your system. It might be the latest release from the Ubuntu Repository or the stable/development version from the WineHQ repositories. We have also described the uninstallation process so you can easily remove Wine from your system, be it for new installation or complete removal.

There is also an alternative Wine-based installer available for installing Windows software on Linux named PlayOnLinux. A tutorial for PlayOnLinux can be found here.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *