unable to install perl modules on linux

2.2k Views Asked by At

i tried to install perl modules IO::Tty,IO::Pty,Net::SSH2,Net::SSH::Perl....but i have failed to instal a single module.i tried to debug ,but unable to completely fix it.i came to know there is some issue with the compiler.as the below commands have given me the output which indicate something wrong.

which gcc
output 
/usr/bin/which: no gcc in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

whereis gcc
output
gcc:

and when i check the error logs after trying to instal the modules , i get the below mentioned error:

   [root@GTheGandalf ~]# cat /root/.cpanm/work/1439895011.19383/build.log
   ERROR: cannot run the configured compiler 'gcc'
(see conf/compilerok.log). Suggestions:
1) The compiler 'gcc' is not in your PATH. Add it
to the PATH and try again. OR
2) The compiler isn't installed on your system. Install it. OR
3) You only have a different compiler installed (e.g. 'gcc').
Either fix the compiler config in the perl Config.pm
or install a perl that was built with the right compiler
(you could build perl yourself with the available compiler).

Please help me to fix it as i am unable to execute perl scripts which have a dependency on the above mentioned modules.

2

There are 2 best solutions below

2
On

The error message is self-explanatory.

Install gcc and add it to PATH.

Refer: Installing GCC guide

2
On

At least some of the modules you mention are implemented in C. You need the C compiler that what used to install your perl, namely gcc. Use your system's package manager (apt-get, yum, etc) to install it.