Ubuntu 18.04 fresh installed.

$ pkg-config --list-all 2>&1 | grep -A2 -B2 GLib

(pkg-config:31662): GLib-CRITICAL **: 06:08:21.279: g_string_insert_len: assertion 'len == 0 || val != NULL' failed

What the hell is this? Is this something we need to fix? It happens every time I use pkg-config

I had some GLib error during installation already. But system is somehow usable. More like a GLib problem. How can we fix this? And where is the problem actually?

update according @N0rbert

#dpkg --verify

Does not yield any related file change, only some common gnome tweaking xml and conf files. Install the libglib2.0-dev does not help either. Same error pop up after pkg-config --list-all Reinstall with the --reinstall libglib2.0-0 libglib2.0-bin libglib2.0-data does not help either. Well the find is the same as the repo one, so I do not expect this will change anything.

  • Looks like a bug in pkg-config – Elias Apr 16 '19 at 22:24
  • @Elias more like a GLib bug? – Wang Apr 16 '19 at 22:36

1. Check system integrity

I do not see GLib-CRITICAL messages on my systems, so if unsure, then reinstall related packages with:

sudo apt-get install --reinstall libglib2.0-0 libglib2.0-bin libglib2.0-data

If problem persists, then check system integrity with:

sudo dpkg --verify

or debsums:

sudo apt-get install debsums
sudo debsums --all --changed

and reinstall packages with possible damaged/missed/changed files.

2. Install packages with *.pc files

About *.pc files. If you visit search on https://packages.ubuntu.com and evaluate search for *.pc files inside packages you will see the long list of related packages and files:

glib .pc s

So you need to install some related dev-packages.

At least one libglib2.0-dev with glib-2.0.pc:

sudo apt-get install libglib2.0-dev

and you will get something like:

$ pkg-config --list-all | grep -A2 -B2 GLib
iso-codes                      iso-codes - ISO country, language, script and currency codes and translations
caja-python                    Caja-Python - Caja-Python Components
gobject-2.0                    GObject - GLib Type, Object, Parameter and Signal Library
gmodule-export-2.0             GModule - Dynamic module loader for GLib
libpcreposix                   libpcreposix - PCREPosix - Posix compatible interface to libpcre
geoclue-2.0                    Geoclue - The Geoinformation Service
adwaita-icon-theme             gnome-icon-theme - A collection of icons used as the basis for GNOME themes
libpcre                        libpcre - PCRE - Perl compatible regular expressions C library with 8 bit character support
glib-2.0                       GLib - C Utility Library
mate-keybindings               mate-keybindings - Keybindings configuration for MATE applications
gmodule-2.0                    GModule - Dynamic module loader for GLib
gnome-system-tools             gst - Gnome System Tools
gthread-2.0                    GThread - Thread support for GLib
caja-sendto                    caja-sendto - Extend caja-sendto through plugins
xbitmaps                       X bitmaps - Bitmaps that are shared between X applications
libpcre32                      libpcre32 - PCRE - Perl compatible regular expressions C library with 32 bit character support
xkeyboard-config               XKeyboardConfig - X Keyboard configuration data
gmodule-no-export-2.0          GModule - Dynamic module loader for GLib
xkbcomp                        xkbcomp - XKB keymap compiler

(tested on clean Ubuntu 18.04.2 LTS virtual machine)

Note: Debian and Ubuntu are not source-based GNU/Linux distributions, i.e. they are not Gentoo or Funtoo. For latter it is expected to have includes and development packages and tools preinstalled, but for Debian it is not expected.

| improve this answer | |
  • In theory, if no other dev repo want this GLib pc info, pkg-config shouldn't even bother to check right? There must be some other packages installed some pc which leads to request this info, but in the mean time fail to make dependencies on it? – Wang Apr 17 '19 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.