How can I get the lastest version of glib on a centos based distro?

Hello ! I’m a complete beginner and I wanted to create an application with GTK in Rust. I tried to compile a blank project with the gtk4 package as a dependency and I got the following error :

Package dependency requirement 'glib-2.0 >= 2.66' could not be satisfied.
  Package 'glib-2.0' has version '2.64.6', required version is '>= 2.66'

I’m on Rocky Linux 8 (so pretty much centOS) so I tried
sudo yum install glib2-devel
But it still did not give me a recent enought version.

I tried grabbing one from here : RPM resource glib2-devel
But it complained about dependency requirements it could not meet (which makes sense, the most recent version of glib2-devel probably depends on the most recent version of other things, and those probably won’t be in the repos I have as well).

I also tried the gtk4 and gtk4-devel packages from the raven repo.

Any advice ? Thanks in advance !

Hi, you’ll need to either build it yourself, or use a newer distro (e.g. Fedora 34, possibly via a container image). The whole point of enterprise distros is to be old and stable. You’re just not going to find the newest stuff with Rocky/CentOS/RHEL etc.

Trying to install a newer version is not a good idea because glib is a low-level system component and installing your own could have unpredictable effects on just about anything. But if you really want to do it, your glib2 and glib2-devel package versions would need to match exactly.

1 Like

I tried building it myself but I got a few errors while building…
I think I’ll just use a newer distro.

You can also use GNOME Builder to develop on top of flatpak, as outlined in the newcomers guide.

The guide is about contributing to an existing project, but the bits about installing builder/flatpak apply to new projects as well.

Basically this allows you to develop against a runtime/SDK that is isolated from the host system. In other words, you can write bleeding edge software on a boring old stable OS :joy:

1 Like

Thanks for the info !