'Flutter Doctor shows problem with GTK 3.0 for CentOS Linux 7 running on Doctor

Goal: Compile and run flutter examples emulating Linux Desktop on CentOS 7 docker container

(Note: Can't use snapd - not supported within Docker) Installed manually

Managed to get everything else cleared up but this one:

  GTK 3.0 development libraries are required for Linux development.
  They are likely available from your distribution (e.g.: apt install
  libgtk-3-dev)
The others show OK:
Γú[Γ£ù] Linux toolchain - develop for Linux desktop
    ΓÇó clang version 3.4.2 (tags/RELEASE_34/dot2-final)
    ΓÇó cmake3 version 3.17.5
    ΓÇó ninja version 1.10.2
    ΓÇó pkg-config version 0.29.2

Γú[Γ£ô] Connected device (1 available)
    ΓÇó Linux (desktop) ΓÇó linux ΓÇó linux-x64 ΓÇó CentOS Linux 7 (Core)
      4.19.76-linuxkit

Another thread had asked for specific versions when diagnosing this. Here they are:

pkg-config --modversion gtk+-3.0 3.22.30

pkg-config --modversion glib-2.0 2.56.1

pkg-config --modversion gio-2.0 2.56.1

pkg-config --modversion blkid 2.23.0

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib/pkg config:

Would LOVE some help getting this resolved!!!!



Solution 1:[1]

It appears most of this has to do with pathing, some of the libs have slightly different names (gtk3-devel, libblkid-devel, xz-devel). Some irritations around cmake3, and getting more current versions of pkg-config, xproto, kbproto, xextproto, and the configuration of said packages. At least now I have a clean flutter doctor.

Now, on to trying to run it...

Solution 2:[2]

I updated my Ubuntu to version 22.04 LTS, and when I needed to install Flutter and Android Studio I ran into a similar error in flutter doctor output:

GTK 3.0 development libraries are required for Linux development.
They are likely available from your distribution (e.g.: apt install libgtk-3-dev)

Command apt install libgtk-3-dev returned various errors, at first something like:

libgtk-3-dev is already the newest version 

And then i tried to update all packages:

sudo apt-get update
sudo apt-get autoremove
dpkg --get-selections | grep hold

None of these commands didn't do anything...

So, i try to remove libgtk-3-dev, and after that repeat autoremove and try to install libgtk-3-dev again. But now it showed me that it has some unmet dependency (it looks like it depended on some version of libpcre3 and\or libpcre3-dev) and for some reason apt refused to install it.

I tried so many ways to remove this damn package, but I could not do it. As far as I understand, initially the problem is that the version of this shitty package (libpcre3) that I have has been stretching since Ubuntu 18, and there is both a 32-bit version and x64, and dependencies are crooked in some of them ... Well, or some other problem - maybe something was not deleted during the next update, although it should have been.

In the end, I managed to solve the problem using a graphical shell over apt - synaptic (its great stuff, I recommend it to everyone). It's very easy to set up:

sudo apt install synaptic

After that, I found the amd64 version libpcre3 in list, marked it for installation and installed it. After that, just install through the console

sudo apt install libgtk-3-dev

It worked fine, updating all dependencies.

P.S. First thing I want to note is that Flutter is incredibly crooked shit (only my opinion). If you haven’t started developing on it yet, don’t start, choose something more stable. If it will be possible to use this garbage, then only in five years at best...

And secondly, I spent a lot of time searching and solving the problem with the library, which is essentially perl dependencies. Despite the fact that I myself do not use perl at all. Looks like the notorious "Dependency Hell" is already here.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Blaine Fredrickson
Solution 2 Никитос