I have Ubuntu 13.10 32 bit system. Recently when I try to to compile by running ./autogen.sh and ./configure I get

 PKG_PROG_PKG_CONFIG: command not found

error. I have libtool installed. I have three aclocal files in usr/share/ like alocal, aclocal-1.13 and aclocal-1.4

How can I fix that alocal error?


Some time ago I compiled latest version of automake from source and installed it because a source code needed recent version of automake to run configure process. Since then whenever I run standard ./autogen and /configure commands in source directory to generate makefile I get

  PKG_PROG_PKG_CONFIG: command not found


  find /usr -name "pkg.m4"

gives me



  aclocal --print-ac-dir

gives me

  • is the pkg-config package installed? does the file /usr/share/aclocal/pkg.m4 exist on your system? – steeldriver May 18 '14 at 14:03
  • What are you trying to compile? – jobin May 18 '14 at 14:35
  • @steeldriver find /usr -name "pkg.m4" gives me /usr/share/aclocal/pkg.m4 – kenn May 18 '14 at 15:55
  • @Jobin I am trying to compile this: codeload.github.com/blazt/submarine/zip/master – kenn May 18 '14 at 15:56
  • What does aclocal --print-ac-dir say? – steeldriver May 18 '14 at 16:01

The PKG_PROG_PKG_CONFIG variable refers to a macro pkg.m4 that is provided as part of the pkg-config package, so the first thing to check is that pkg-config is installed and that the macro file is in the default location (and is readable, of course)

dpkg -l pkg-config

ls -l /usr/share/aclocal/pkg.m4

If that checks out, then the question becomes why is aclocal not finding it? You can check where aclocal is configured to look for third-party m4 files using the --print-ac-dir switch i.e.

aclocal --print-ac-dir

If that's not the same as the location above, it suggests there is a non-standard version of automake on your system - if you can't resolve that, then a possible workaround is to set or export the ACLOCAL_PATH environment variable before running the autogen.sh script e.g.

ACLOCAL_PATH=/usr/share/aclocal ./autogen.sh


export ACLOCAL_PATH=/usr/share/aclocal

See the macro search path section of the GNU automake manual.

  • Or, PKG_PROG_PKG_CONFIG could come from a typo in a variable assignment, e.g. PKG_PROG_PKG_CONFIG<space>=... instead of PKG_PROG_PKG_CONFIG=.... grep "PKG_PROG_PKG_CONFIG " on your files. – waltinator May 22 '14 at 15:38

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.