Ubuntu 24.04 dependency issue (libwebkit)
Description
When running wails dev I ran into this error:
Package webkit2gtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'webkit2gtk-4.0', required by 'virtual:world', not found
Package 'webkit2gtk-4.0', required by 'virtual:world', not found
Package 'webkit2gtk-4.0', required by 'virtual:world', not found
Wails doctor returns:
WARNING Your system has missing dependencies!
Fatal:
Required dependencies missing: libwebkit
Please read this article on how to resolve this: https://wails.io/guides/resolving-missing-packages
♥ If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony
https://wails.io/guides/resolving-missing-packages is also not a valid link
To Reproduce
- Run wails dev
Or
- Wails doctor:
- "Required dependencies missing"
Expected behaviour
Successful build step or found package installed
Screenshots
No response
Attempted Fixes
webkit2gtk-4.0-dev is installed and reinstalled. Wails has also been installed and reinstalled and computer restarted.
System Details
Wails Doctor
# Wails
Version | v2.9.1
Package Manager | apt
# System
┌──────────────────────────────────────────────────────────────────────────────────┐
| OS | Ubuntu |
| Version | 24.04 |
| ID | ubuntu |
| Go Version | go1.22.4 |
| Platform | linux |
| Architecture | amd64 |
| CPU | AMD Ryzen 7 5825U with Radeon Graphics |
| GPU | Barcelo (Advanced Micro Devices, Inc. [AMD/ATI]) - Driver: amdgpu |
| Memory | 23GB |
└──────────────────────────────────────────────────────────────────────────────────┘
# Dependencies
┌─────────────────────────────────────────────────────────────┐
| Dependency | Package Name | Status | Version |
| *docker | docker.io | Installed | 26.1.4 |
| gcc | build-essential | Installed | 12.10ubuntu1 |
| libgtk-3 | libgtk-3-dev | Installed | 3.24.41-4ubuntu1 |
| libwebkit | Unknown | Not Found | |
| npm | npm | Installed | 10.8.1 |
| *nsis | nsis | Available | 3.09-4ubuntu1 |
| pkg-config | pkg-config | Installed | 1.8.1-2build1 |
└────────────────── * - Optional Dependency ──────────────────┘
# Diagnosis
Optional package(s) installation details:
- nsis: sudo apt install nsis
WARNING Your system has missing dependencies!
Fatal:
Required dependencies missing: libwebkit
Please read this article on how to resolve this: https://wails.io/guides/resolving-missing-packages
♥ If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony
Additional context
No response
This should fix it for you: https://wails.io/docs/gettingstarted/building We should probably add a message if we can detect the OS.
I have tried to add flag -tags webkit2_41 to my wails build multiple times. However, I still did not manage to build the binary. So instead of doing that over and over again. I tried this;
-
Add the previous repo and install the needed webkit. Open your terminal and
sudo nano /etc/apt/sources.list.d/ubuntu.sources -
Add the following lines
Types: deb
URIs: http://br.archive.ubuntu.com/ubuntu/
Suites: jammy noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: jammy-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
-
Update the repo again by
sudo apt updateand install the needed dependenciessudo apt install libwebkit2gtk-4.0-dev -
Now, since this is a dirty hack, you need to reinstate the original PPA list. So just undo step 2, by removing the lines, and save.
# Wails
Version | v2.9.1
Package Manager | apt
# System
┌───────────────────────────────────────────────────────────────────┐
| OS | Ubuntu |
| Version | 24.04 |
| ID | ubuntu |
| Go Version | go1.22.2 |
| Platform | linux |
| Architecture | amd64 |
| CPU | Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz |
| GPU | HD Graphics 620 (Intel Corporation) - Driver: i915 |
| Memory | 15GB |
└───────────────────────────────────────────────────────────────────┘
# Dependencies
┌──────────────────────────────────────────────────────────────────────────┐
| Dependency | Package Name | Status | Version |
| *docker | docker.io | Available | 24.0.7-0ubuntu4 |
| gcc | build-essential | Installed | 13.2.0 |
| libgtk-3 | libgtk-3-dev | Installed | 3.24.41-4ubuntu1.1 |
| libwebkit | libwebkit2gtk-4.0-dev | Installed | 2.44.2-0ubuntu0.22.04.1 |
| npm | npm | Installed | 10.8.2 |
| *nsis | nsis | Available | 3.09-4ubuntu1 |
| pkg-config | pkg-config | Installed | 1.8.1 |
└──────────────────────── * - Optional Dependency ─────────────────────────┘
I have tried to add flag
-tags webkit2_41to mywails buildmultiple times. However, I still did not manage to build the binary. So instead of doing that over and over again. I tried this;1. Add the previous repo and install the needed webkit. Open your terminal and `sudo nano /etc/apt/sources.list.d/ubuntu.sources` 2. Add the following linesTypes: deb URIs: http://br.archive.ubuntu.com/ubuntu/ Suites: jammy noble-updates noble-backports Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg Types: deb URIs: http://security.ubuntu.com/ubuntu/ Suites: jammy-security Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg3. Update the repo again by `sudo apt update` and install the needed dependencies `sudo apt install libwebkit2gtk-4.0-dev` 4. Now, since this is a dirty hack, you need to reinstate the original PPA list. So just undo step 2, by removing the lines, and save.# Wails Version | v2.9.1 Package Manager | apt # System ┌───────────────────────────────────────────────────────────────────┐ | OS | Ubuntu | | Version | 24.04 | | ID | ubuntu | | Go Version | go1.22.2 | | Platform | linux | | Architecture | amd64 | | CPU | Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz | | GPU | HD Graphics 620 (Intel Corporation) - Driver: i915 | | Memory | 15GB | └───────────────────────────────────────────────────────────────────┘ # Dependencies ┌──────────────────────────────────────────────────────────────────────────┐ | Dependency | Package Name | Status | Version | | *docker | docker.io | Available | 24.0.7-0ubuntu4 | | gcc | build-essential | Installed | 13.2.0 | | libgtk-3 | libgtk-3-dev | Installed | 3.24.41-4ubuntu1.1 | | libwebkit | libwebkit2gtk-4.0-dev | Installed | 2.44.2-0ubuntu0.22.04.1 | | npm | npm | Installed | 10.8.2 | | *nsis | nsis | Available | 3.09-4ubuntu1 | | pkg-config | pkg-config | Installed | 1.8.1 | └──────────────────────── * - Optional Dependency ─────────────────────────┘
This worked perfectly for me on Linux Mint, thank you.
Does the solution mentioned by @leaanthony allow a single binary to use either 2.40 or 2.41? For example, users who are on the latest Ubuntu can run it with 2.41 and other Linux users can run it using 2.40 without having to distribute separate binaries for each.
I have tried to add flag
-tags webkit2_41to mywails buildmultiple times. However, I still did not manage to build the binary. So instead of doing that over and over again. I tried this;1. Add the previous repo and install the needed webkit. Open your terminal and `sudo nano /etc/apt/sources.list.d/ubuntu.sources` 2. Add the following linesTypes: deb URIs: http://br.archive.ubuntu.com/ubuntu/ Suites: jammy noble-updates noble-backports Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg Types: deb URIs: http://security.ubuntu.com/ubuntu/ Suites: jammy-security Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg3. Update the repo again by `sudo apt update` and install the needed dependencies `sudo apt install libwebkit2gtk-4.0-dev` 4. Now, since this is a dirty hack, you need to reinstate the original PPA list. So just undo step 2, by removing the lines, and save.# Wails Version | v2.9.1 Package Manager | apt # System ┌───────────────────────────────────────────────────────────────────┐ | OS | Ubuntu | | Version | 24.04 | | ID | ubuntu | | Go Version | go1.22.2 | | Platform | linux | | Architecture | amd64 | | CPU | Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz | | GPU | HD Graphics 620 (Intel Corporation) - Driver: i915 | | Memory | 15GB | └───────────────────────────────────────────────────────────────────┘ # Dependencies ┌──────────────────────────────────────────────────────────────────────────┐ | Dependency | Package Name | Status | Version | | *docker | docker.io | Available | 24.0.7-0ubuntu4 | | gcc | build-essential | Installed | 13.2.0 | | libgtk-3 | libgtk-3-dev | Installed | 3.24.41-4ubuntu1.1 | | libwebkit | libwebkit2gtk-4.0-dev | Installed | 2.44.2-0ubuntu0.22.04.1 | | npm | npm | Installed | 10.8.2 | | *nsis | nsis | Available | 3.09-4ubuntu1 | | pkg-config | pkg-config | Installed | 1.8.1 | └──────────────────────── * - Optional Dependency ─────────────────────────┘
Thank you this worked for me on linux mint!
The only thing i did different was I just used sudo nano /etc/apt/sources.list.d/official-package-repositories.list and then added the following lines:
deb http://br.archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
deb http://br.archive.ubuntu.com/ubuntu/ noble-updates main restricted universe multiverse
deb http://br.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
Glad it was sorted. Would you be up for creating a PR to update the docs on this? It sure would help a bunch of people.
For other people running into issues running wails dev with -tags webkit2_41 who encounter the error message AcceleratedSurfaceDMABuf was unable to construct a complete framebuffer see: https://github.com/tauri-apps/tauri/issues/9304
Would it be possible to drop the webkit2_41 tag and default to using libwebkit2gtk-4.1-dev or would this somehow cause additional issues?
Not sure how many systems that will break
Yes, I wouldn't want to break support for too many systems.
In my small bit of testing I'm able to run apps built with the webkit2_41 tag on Ubuntu 22.04 and Ubuntu 24.04 provided they have the necessary packages installed. But I'm not knowledgeable enough about the libwebkit2gtk package or Linux OSes to figure out if a reasonable amount of distros would still be supported by defaulting to the webkit2_41 build.
Maybe someone with more Linux experience than me knows if there's a good way to gauge Linux support.
Yeah, ultimately this comes down to a distribution issue. We're addressing this in v3 with support for AppImage and some formats of packages.
I have tried to add flag
-tags webkit2_41to mywails buildmultiple times. However, I still did not manage to build the binary. So instead of doing that over and over again. I tried this;1. Add the previous repo and install the needed webkit. Open your terminal and `sudo nano /etc/apt/sources.list.d/ubuntu.sources` 2. Add the following linesTypes: deb URIs: http://br.archive.ubuntu.com/ubuntu/ Suites: jammy noble-updates noble-backports Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg Types: deb URIs: http://security.ubuntu.com/ubuntu/ Suites: jammy-security Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg3. Update the repo again by `sudo apt update` and install the needed dependencies `sudo apt install libwebkit2gtk-4.0-dev` 4. Now, since this is a dirty hack, you need to reinstate the original PPA list. So just undo step 2, by removing the lines, and save.# Wails Version | v2.9.1 Package Manager | apt # System ┌───────────────────────────────────────────────────────────────────┐ | OS | Ubuntu | | Version | 24.04 | | ID | ubuntu | | Go Version | go1.22.2 | | Platform | linux | | Architecture | amd64 | | CPU | Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz | | GPU | HD Graphics 620 (Intel Corporation) - Driver: i915 | | Memory | 15GB | └───────────────────────────────────────────────────────────────────┘ # Dependencies ┌──────────────────────────────────────────────────────────────────────────┐ | Dependency | Package Name | Status | Version | | *docker | docker.io | Available | 24.0.7-0ubuntu4 | | gcc | build-essential | Installed | 13.2.0 | | libgtk-3 | libgtk-3-dev | Installed | 3.24.41-4ubuntu1.1 | | libwebkit | libwebkit2gtk-4.0-dev | Installed | 2.44.2-0ubuntu0.22.04.1 | | npm | npm | Installed | 10.8.2 | | *nsis | nsis | Available | 3.09-4ubuntu1 | | pkg-config | pkg-config | Installed | 1.8.1 | └──────────────────────── * - Optional Dependency ─────────────────────────┘Thank you this worked for me on linux mint!
The only thing i did different was I just used
sudo nano /etc/apt/sources.list.d/official-package-repositories.listand then added the following lines:deb http://br.archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse deb http://br.archive.ubuntu.com/ubuntu/ noble-updates main restricted universe multiverse deb http://br.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
worked for me
On Fedora 41, when I run wails dev I see:
Package 'webkit2gtk-4.0' not found
I ran wails doctor and it said webkit2gtk4.0-devel was installed.
# Dependencies
┌────────────────────────────────────────────────────────┐
| Dependency | Package Name | Status | Version |
| *docker | moby-engine | Installed | 28.3.0 |
| gcc | gcc-c++ | Installed | 14.3.1 |
| libgtk-3 | gtk3-devel | Installed | 3.24.43 |
| libwebkit | webkit2gtk4.0-devel | Installed | 2.46.5 |
| npm | nodejs-npm | Installed | 10.9.2 |
| pkg-config | pkgconf-pkg-config | Installed | 2.3.0 |
| *upx | upx | Installed | 5.0.1 |
| |
└─────────────── * - Optional Dependency ────────────────┘
However, after running sudo dnf install webkit2gtk4.0-devel the error went away and wails dev started working.
It makes me wonder: Does wails doctor have a bug where it misreports whether webkit2gtk4.0-devel is installed on Fedora 41?
Edit: I ran into the same issue on Arch Linux and brew doctor seems to work as expected on that computer:
# Dependencies
┌───────────────────────────────────────────────────────────────────┐
| Dependency | Package Name | Status | Version |
| *docker | docker | Available | 1:28.2.2-1 |
| gcc | gcc | Installed | 15.1.1+r7+gf36ec88aa85a-1 |
| libgtk-3 | gtk3 | Installed | 1:3.24.49-2 |
| libwebkit | webkit2gtk | Available | 2.48.3-1 |
| npm | npm | Installed | 11.2.0 |
| pkg-config | pkgconf | Installed | 2.4.3-1 |
| |
└───────────────────── * - Optional Dependency ─────────────────────┘
# Diagnosis
Required package(s) installation details:
- libwebkit: sudo pacman -S webkit2gtk
Optional package(s) installation details:
- docker: sudo pacman -S docker
So it seems like a Fedora 41 + wails doctor bug. I will report as a new issue.
Edit: Raised #4457
I have tried to add flag
-tags webkit2_41to mywails buildmultiple times. However, I still did not manage to build the binary. So instead of doing that over and over again. I tried this;1. Add the previous repo and install the needed webkit. Open your terminal and `sudo nano /etc/apt/sources.list.d/ubuntu.sources` 2. Add the following linesTypes: deb URIs: http://br.archive.ubuntu.com/ubuntu/ Suites: jammy noble-updates noble-backports Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg Types: deb URIs: http://security.ubuntu.com/ubuntu/ Suites: jammy-security Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg3. Update the repo again by `sudo apt update` and install the needed dependencies `sudo apt install libwebkit2gtk-4.0-dev` 4. Now, since this is a dirty hack, you need to reinstate the original PPA list. So just undo step 2, by removing the lines, and save.# Wails Version | v2.9.1 Package Manager | apt # System ┌───────────────────────────────────────────────────────────────────┐ | OS | Ubuntu | | Version | 24.04 | | ID | ubuntu | | Go Version | go1.22.2 | | Platform | linux | | Architecture | amd64 | | CPU | Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz | | GPU | HD Graphics 620 (Intel Corporation) - Driver: i915 | | Memory | 15GB | └───────────────────────────────────────────────────────────────────┘ # Dependencies ┌──────────────────────────────────────────────────────────────────────────┐ | Dependency | Package Name | Status | Version | | *docker | docker.io | Available | 24.0.7-0ubuntu4 | | gcc | build-essential | Installed | 13.2.0 | | libgtk-3 | libgtk-3-dev | Installed | 3.24.41-4ubuntu1.1 | | libwebkit | libwebkit2gtk-4.0-dev | Installed | 2.44.2-0ubuntu0.22.04.1 | | npm | npm | Installed | 10.8.2 | | *nsis | nsis | Available | 3.09-4ubuntu1 | | pkg-config | pkg-config | Installed | 1.8.1 | └──────────────────────── * - Optional Dependency ─────────────────────────┘
Thanks man. It worked for my Ubuntu 2024 LTS!
Looks like this can be closed now 👍