Score:1

Package gtk+-3.0 was not found in the pkg-config search path

us flag

I'm running Ubuntu 18.04.4 LTS

When running

pkg-config --cflags gtk+-3.0 I get the following error -

Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-3.0' found

I've tried installing missing packages (sudo apt-get install build-essential libgtk-3-dev ), as per pkg-config not finding gtk+-3.0, however when running

dpkg -l libgtk* | grep -e '^i' | grep -e 'libgtk-*[0-9]' I still get zsh: no matches found: libgtk* with the same error still happening.

I'm unable to download certain go packages due to this issue - does anyone have any ideas?

hr flag
To make your last command work the way you expect in zsh, either quote `libgtk*` or use `setopt nonomatch`
Tom Yeoman avatar
us flag
Thanks, I now get `zsh: no matches found: libgtk*, zsh: no matches found: libgtk-*[0-9]`
N0rbert avatar
zw flag
You are searching for wrong files, I think. You should search by `dpkg -S gtk+-3.0.pc` and `pkg-config --cflags gtk+-3.0` . Also I have a question - why do you run 18.04.4 instead of 18.04.5? You are probably missing major system upgrades by doing so.
hr flag
@TomYeoman that *sounds* like you **un**quoted `'libgtk-*[0-9]'` instead of **quoted** `'libgtk*'`
Tom Yeoman avatar
us flag
I'm running ubuntu on WSL2, i'll look into upgrading :). I'm wondering if this could be part of my problem, as it's headerless? Thanks for the command @N0rbert I now get `libgtk-3-dev:amd64: /usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-3.0.p` returned
Tom Yeoman avatar
us flag
I still however get the `Package gtk+-3.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-3.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-3.0' found` error message when running `pkg-config --cflags gtk+-3.0`
N0rbert avatar
zw flag
So, after 18 hours, you really understood that mention of WSL maybe helpful. Great! In any way output of `pkg-config --list-all --debug` may help.
Score:1
zw flag

Use search for gtk+-3.0.pc on https://packages.ubuntu.com and then execute

sudo apt-get install libgtk-3-dev

When all packages installed you can try to reinstall pkg-config, and then manually raise pkg-config trigger/hook by

sudo apt-get install --reinstall pkg-config
sudo /usr/share/pkg-config-dpkghook update

and then retry with

pkg-config --cflags gtk+-3.0
Tom Yeoman avatar
us flag
Thanks. When running that I get `libgtk-3-dev is already the newest version (3.22.30-1ubuntu4).`, I had already run the command `sudo apt-get install build-essential libgtk-3-dev` as mentioned on the original post, so that would explain it?
N0rbert avatar
zw flag
This is how this should work. You are probably have changed environment by Anaconda or something similar and gigantic.
hr flag
@TomYeoman if you have manually deleted the .pc file you may need to **re**install the package (`sudo apt install --reinstall libgtk-3-dev`)
Tom Yeoman avatar
us flag
Thanks I've tried re-installing, and also ran `dpkg -S gtk+-3.0.p` to confirm it exists, I get the output `libgtk-3-dev:amd64: /usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-3.0.pc`. However running `pkg-config --cflags gtk+-3.0` still returns `Package gtk+-3.0 was not found in the pkg-config search path. Perhaps you should add the directory containing gtk+-3.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-3.0' found` Could it be that i'm running ubuntu in WSL2, which is heade less, and there's some sort of GUI requirement?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.