6

I've installed libxml2-dev in my Ubuntu 20.04 terminal (under WSL), as it's a requirement for pgModeler. I used sudo apt-get install libxml2-dev and it seemed to install ok. The pgModeler instruction includes "To check if the library is correctly installed" run this command: pkg-config libxml­2.0 --cflags --libs For me, this gives:

Package libxml2.0 was not found in the pkg-config search path. 
Perhaps you should add the directory containing 'libxml2.0.pc'
to the PKG_CONFIG_PATH environment variable 
No package 'libxml2.0' found

Answers to some questions suggest adding the path to PKG_CONFIG_PATH. To determine what path to check, I installed locate (sudo apt install mlocate) and using locate libxml | grep '\.pc', I found that this file exists:

/usr/lib/x86_64-linux-gnu/pkgconfig/libxml-2.0.pc

Then running pkg-config --variable pc_path pkg-config gives (my highlighting):

/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

which indicates to me that /usr/lib/x86_64-linux-gnu/pkgconfig is already in the default path for pkg-config.

So, why would I get "No package 'libxml2.0' found", and how might I fix this?

1 Answers1

7

You have to ignore the suggestion from pgModeler documentation.

Correct name of the libxml2 configuration file for pkg-config is libxml-2.0.pc, you have already installed it from libxml2-dev package.

Simply proceed with the compilation:

sudo apt-get install git build-essential libxml2-dev qt5-default libpqxx-dev libpq-dev libqt5svg5-dev qttools5-dev

cd ~/Downloads git clone https://github.com/pgmodeler/pgmodeler.git -b master cd pgmodeler git clone https://github.com/pgmodeler/plugins -b master qmake PREFIX+=/usr/local -r pgmodeler.pro make -j$(nproc) sudo make install

Also you should know that pgModeler 0.9.2 is packaged in Ubuntu 20.04 LTS at https://packages.ubuntu.com/focal/pgmodeler, so it installable as simple as

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install pgmodeler
N0rbert
  • 103,263