Make[1]: root-config: Command not found


I am installing a code on Ubuntu using a makefile. I had a very similar installation already working in another place in the same computer and I have installed all the dependencies required to run root.

When I tried to make the second version of the code I get this message

After this the compilation is terminated because it cannot find “TFile.h”, etc which are part of the main code.

The Linux makefile starts as ROOTINC = $(shell root-config --cflags) ROOTLIB = $(shell root-config --libs)

But when I type these into the terminal manually, I get root-config --cflags -pthread -m64 -I/home/ri00017/Downloads/root/root/include and root-config --libs -L/home/ri00017/Downloads/root/root/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic

It looks like this was a similar topic [url]Compiling errors with ‘root-config’ but adding parentheses doesn’t solve the problem.

I then tried to remake the software that worked and I had been using before but I get the same poblem there. Although it had installed fine just a few days before that. Could anybody help me?



In your terminal window, before you run “make”, you need to execute something like: . /home/ri00017/Downloads/root/root/bin/

Thanks! I did this (in the root folder with ./bin/ but I still have the same problem with root-config…

Just to make sure … you did (note the two dots with a space between): . ./bin/ and in the same terminal window you executed “make” afterwards.

I hadn’t used the two .'s . Just did this and in the same window ran the make. It worked and started the make but I need to be sudo to be able to compile this code fully and when I run as sudo, I get the same make[1]: root-config: Command not found message.

I tried the same with the gdb command line - if I make it, it starts but permission is denied when it starts making the output files and when I run gdb as sudo, I get the root-config: Command not found message.

First execute “sudo bash” and then work inside of this new shell.

1 Like


Thanks for your suggestion. I was also having this problem and it helped me. Why does this work, though?


google for … sudo PATH

Hm. It seems a bit strange to me that it is suggested to use sudo?! Don’t use sudo! Don’t work with root privileges. Run ROOT as normal user. Don’t run ROOT as root! Compile as normal user. root-config works completely fine as a normal user.

So instead of “fixing” the problem “I need to be sudo to be able to compile this code” by granting admin privileges, the real solution would be to fix the Makefile (or whatever build system is used) to not require admin privileges!

Some data acquisition codes that rely on root are meant to be installed as root.