LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   -bash: gccL command not found (https://www.linuxquestions.org/questions/linux-server-73/bash-gccl-command-not-found-790781/)

jhusted 02-22-2010 09:00 AM

-bash: gccL command not found
 
New to linux. Gcc seems to be installed by not configured maybe? Below are some command line results. Is gcc installed, and if so, how do I configure it so it run properly? Thank you.

rpm -qa | grep gcc

libgcc-4.1.2-44.el5
gcc-4.1.2-44.el5
gcc-gfortran-4.1.2-44.el5
compat-libgcc-296-2.96-138
compat-gcc-34-g77-3.4.6-4
compat-gcc-34-c++-3.4.6-4
gcc-c++-4.1.2-44.el5
compat-gcc-34-3.4.6-4

gcc --version

-bash: gcc: command not found

which gcc

/usr/bin/which: no gcc in (/usr/ora/d02/oracle/fdidb/9.2.0/Apache/perl/bin:/usr/ora/d02/oracle/fdidb/9.2.0/bin:/usr/bin:/usr/sbin:/usr/ora/d02/oracle/fdidb/9.2.0/jre/1.4.2/bin:/usr/ccs/bin:/bin:/usr/bin/X11:/usr/local/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin:/usr/ora/d02/oracle/fdidb/9.2.0/jre/1.4.2/bin:.)

eyemole80 02-22-2010 09:03 AM

rpm -ql gcc-4.1.2-44.el5 | egrep '/usr/bin'

Use the above command , and u will know where gcc is installed.

jhusted 02-22-2010 10:02 AM

rpm -ql gcc-4.1.2-44.el5 | egrep '/usr/bin'
/usr/bin/c89
/usr/bin/c99
/usr/bin/cc
/usr/bin/gcc
/usr/bin/gcov
/usr/bin/i386-redhat-linux-gcc
/usr/bin/protoize
/usr/bin/unprotoize

So this tells me where gcc is installed. Is making sure the location is in the PATH enough?

colucix 02-22-2010 10:46 AM

Quote:

Originally Posted by jhusted (Post 3872696)
Is making sure the location is in the PATH enough?

Yes. But the output from the which command shows that /usr/bin is actually in your PATH (indeed if it were not there, a lot of other things could not work). At this point you can check the integrity of the gcc package:
Code:

rpm -V gcc
and eventually if /usr/bin/gcc is a broken link, instead of a real executable. I assume the error message shown in the title of this thread is affected by a typo:
Code:

-bash: gccL command not found

jhusted 02-22-2010 11:19 AM

Yes, a typo should be gcc:


Here's my result from rpm -V gcc

.M...... /usr/bin/gcc
prelink: /lib/libc-2.5.so has a dependency cycle
prelink: /usr/bin/gcov: at least one of file's dependencies has changed since prelinking
S.?..... /usr/bin/gcov
prelink: /lib/libc-2.5.so has a dependency cycle
prelink: /usr/bin/i386-redhat-linux-gcc: at least one of file's dependencies has changed since prelinking
S.?..... /usr/bin/i386-redhat-linux-gcc
prelink: /lib/libc-2.5.so has a dependency cycle
prelink: /usr/bin/protoize: at least one of file's dependencies has changed since prelinking
S.?..... /usr/bin/protoize
prelink: /lib/libc-2.5.so has a dependency cycle
prelink: /usr/bin/unprotoize: at least one of file's dependencies has changed since prelinking
S.?..... /usr/bin/unprotoize
prelink: /lib/libc-2.5.so has a dependency cycle
prelink: /usr/libexec/gcc/i386-redhat-linux/4.1.1/collect2: at least one of file's dependencies has changed since prelinking
S.?..... /usr/libexec/gcc/i386-redhat-linux/4.1.1/collect2

colucix 02-22-2010 11:32 AM

Code:

.M...... /usr/bin/gcc
This confirms that the files originally installed by the gcc package have been modified. In particular, M means "Mode differs (includes permissions and file type)". I suspect that this is due to a subsequent installation of the compat-gcc-34 package. Can you verify what /usr/bin/gcc actually is? For example, a simple
Code:

ls -l /usr/bin/gcc*
should give some clue.

jhusted 02-22-2010 11:48 AM

ls -l /usr/bin/gcc*

-rwxr-xr-x 2 root root 92956 Jun 5 2007 /usr/bin/gcc34
-rwxr-xr-x 1 root root 2018 Jun 5 2007 /usr/bin/gccmakedep
-rwxr-xr-x 2 root root 202368 Nov 5 2008 /usr/bin/gcc.orig
-rwxr-xr-x 1 root root 914 May 22 2008 /usr/bin/gcc.original

colucix 02-22-2010 12:06 PM

As you can see, gcc is not there! However, looking at its size, I can confirm that /usr/bin/gcc.orig is the original /usr/bin/gcc executable (that one provided by the gcc-4.1.2 package). The question now is how to restore the gcc package. If you're not the system administrator of this machine, you have to ask him/her to restore it for you. Otherwise, you can try to rename /usr/bin/gcc.orig to /usr/bin/gcc. I doubt the solution can be so simple, due to the number of warnings you got from the package verification.

You have to investigate the reasons of these modifications and then eventually you can try to force the gcc re-installation:
Code:

yum reinstall gcc

jhusted 02-22-2010 12:28 PM

Thank you for the suggestions.


All times are GMT -5. The time now is 01:15 PM.