INSTALLATION: ./autogen.sh and =No package 'glib-2.0' found= error

111 views
Skip to first unread message

lolo pinpin

unread,
Jun 12, 2021, 12:18:04 AM6/12/21
to mu-discuss

Hello!
I want to use mu4e on my Ubuntu 20.04. It noticed that my mu --version was old (1.2) and that gave me a hard time following a youtube instructional , so I decided to uninstall it and go for a newer version instead. I tried installation with git, but I am stuck at the "./autogen.sh" step:

when I
$ cd mu
$ ./autogen.sh

I get a bunch of successful checks, then:
checking for GLIB... no
configure: error: Package requirements (glib-2.0 >= 2.50 gobject-2.0 gio-2.0) were not met:

No package 'glib-2.0' found
No package 'gobject-2.0' found
No package 'gio-2.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GLIB_CFLAGS
and GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I honestly have no idea what to make of the suggestions ( such as :"adjusting the PKG_CONFIG_PATH etc), I was hoping for some guidance, thank you so much!
laurent

=No package 'glib-2.0' found= error

lolo pinpin

unread,
Jun 14, 2021, 2:08:36 AM6/14/21
to mu-discuss

additional info:

--------------------------------------------------------
which pkg-config
/home/linuxbrew/.linuxbrew/bin/pkg-config
-------------------------------------------------------------------
whereis pkg-config
pkg-config: /usr/bin/pkg-config /usr/lib/pkg-config.multiarch /home/linuxbrew/.linuxbrew/bin/pkg-config /usr/share/man/man1/pkg-config.1.gz
-------------------------------------------------------------------------
dpkg -L pkg-config
/.
/etc
/etc/dpkg
/etc/dpkg/dpkg.cfg.d
/etc/dpkg/dpkg.cfg.d/pkg-config-hook-config
/usr
/usr/bin
/usr/bin/pkg-config
/usr/bin/x86_64-pc-linux-gnu-pkg-config
/usr/lib
/usr/lib/pkg-config.multiarch
/usr/lib/pkgconfig
/usr/share
/usr/share/aclocal
/usr/share/aclocal/pkg.m4
/usr/share/doc
/usr/share/doc/pkg-config
/usr/share/doc/pkg-config/AUTHORS
/usr/share/doc/pkg-config/NEWS.gz
/usr/share/doc/pkg-config/README
/usr/share/doc/pkg-config/changelog.Debian.gz
/usr/share/doc/pkg-config/copyright
/usr/share/doc/pkg-config/pkg-config-guide.html
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/pkg-config.1.gz
/usr/share/pkg-config-crosswrapper
/usr/share/pkg-config-dpkghook
/usr/share/pkgconfig



Joost Kremers

unread,
Jun 14, 2021, 3:05:26 AM6/14/21
to mu-di...@googlegroups.com, lolo pinpin
Hi,

On Sun, Jun 13 2021, lolo pinpin wrote:
[...]
>> *checking for GLIB... noconfigure: error: Package requirements (glib-2.0
>> >= 2.50 gobject-2.0 gio-2.0) were not met:No package 'glib-2.0' foundNo
>> package 'gobject-2.0' foundNo package 'gio-2.0' foundConsider adjusting the
>> PKG_CONFIG_PATH environment variable if youinstalled software in a
>> non-standard prefix.Alternatively, you may set the environment variables
>> GLIB_CFLAGSand GLIB_LIBS to avoid the need to call pkg-config.See the
>> pkg-config man page for more details.*
[...]
> additional info:
>
> --------------------------------------------------------
> *which pkg-config*
> /home/linuxbrew/.linuxbrew/bin/pkg-config
> -------------------------------------------------------------------

You're probably running into the same problem that I ran into: linuxbrew
installed its own version of pkg-config as the result of some dependency. This
pkg-config shadows the system pkg-config and only looks in the linuxbrew tree.
If glib isn't found there, you'll get this error.

You could install mu/mu4e with linuxbrew as well, which, however, will also pull
in Emacs (and a bunch of other stuff). In principle I wouldn't mind, but I
haven't been able to find out how to install a GUI Emacs with linuxbrew. So I
decided to go another way. I wrote a small shell script that sets the path and
then compiles mu/mu4e:

```
#/bin/bash

# Set PATH to a minimal value, so that linuxbrew doesn't interfere.

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

./autogen.sh

make
```

Place it in the mu source directory, make it executable (`chmod 755 my-build.sh`)
and run it with `./my-build.sh`.

The script doesn't install the files, but that can be done from the command
line: linuxbrew doesn't interfere (at least not on my machine).

HTH


--
Joost Kremers
Life has its moments

jman

unread,
Jun 14, 2021, 4:32:34 AM6/14/21
to mu-di...@googlegroups.com

lolo pinpin <alun.laur...@gmail.com> writes:

>> I honestly have no idea what to make of the suggestions ( such as
>> :"adjusting the PKG_CONFIG_PATH etc), I was hoping for some guidance, thank
>> you so much!
>> laurent
>>
>> =No package 'glib-2.0' found= error
>>
>>

I am not super-familiar with Ubuntu package names, did you try searching
for the error string "No package 'glib-2.0' found" instead? The "pkg-config"
suggestion error may be misleading, the root problem looks like you are
missing one or more needed packages to compile =mu=.

Best,

lolo pinpin

unread,
Jun 15, 2021, 12:27:03 AM6/15/21
to mu-discuss
I ran your script Joost and it ran its course without problem, I did not get any error message. Thank you!
I have not documented my entire installation process, I am sure I might encounter the same pbms on the next machine. Where did I go wrong initially, wasn't I supposed to install pkg-config with linuxbrew?

Joost Kremers

unread,
Jun 15, 2021, 3:26:20 AM6/15/21
to mu-di...@googlegroups.com, lolo pinpin

On Mon, Jun 14 2021, lolo pinpin wrote:
> I ran your script Joost and it ran its course without problem, I did not
> get any error message. Thank you!
> I have not documented my entire installation process, I am sure I might
> encounter the same pbms on the next machine. Where did I go wrong
> initially, wasn't I supposed to install pkg-config with linuxbrew?

Well, "wasn't supposed to" is probably too strong. Some linuxbrew formulae
depend on pkg-config and if you install one of them, pkg-config will get
installed automatically, so it's not always avoidable.

The Homebrew devs are aware of the issue, IIUC, but it seems there's no optimal
solution. By default, Homebrew's pkg-config only searches libraries installed by
Homebrew, because including system libraries can lead to inconsistencies.

So this is basically a situation where the sysadmin (i.e., you ;-) ) is
responsible for ensuring that the machine works... There are basically two
options: one is to use the environment variable PKG_CONFIG_PATH to make
Homebrew's pkg-config look for system libraries as well, the other is to make
sure software that you want to compile outside of Homebrew is compiled in an
environment that doesn't use Homebrew. My script is a way to implement the
second option.

lolo pinpin

unread,
Jun 17, 2021, 1:47:53 AM6/17/21
to mu-discuss
 Hi Joost, thank you for taking the time to explain.
Reply all
Reply to author
Forward
0 new messages