This question already has an answer here:

I am trying to install pocketsphinx and after installation I should run these commands:

export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

But I am interested to know where does this command add the paths? If I want to do it manually, how can I do that?

marked as duplicate by Kusalananda, schily, Romeo Ninov, Jesse_b, chaos Jun 8 '18 at 15:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


What you are doing it setting the variable LD_LIBRARY_PATH to the value /usr/local/lib & PKG_CONFIG_PATH to the value /usr/local/lib/pkgconfig.

The export command means that the variables are added to the environment of subsequently executed commands. So whatever you're running after exporting these variables will have access to them.

So your application will be looking for the variables LD_LIBRARY_PATH & PKG_CONFIG_PATH.

  • But after restarting, I must do it again. How can I permanent the changes? – Hasani Jun 8 '18 at 8:11
  • Assuming you are using bash, add the two lines to your ~/.bash_profile. – rusty shackleford Jun 8 '18 at 9:05

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