LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-04-2013, 02:53 AM   #1
inrtyx
LQ Newbie
 
Registered: Dec 2013
Posts: 9

Rep: Reputation: Disabled
bash gcc command not found


[root@gtzjdb bin]# which gcc
/usr/bin/which: no gcc in (/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)



[root@gtzjdb bin]# ll | grep gcc
lrwxrwxrwx 1 root root 3 Jul 27 22:03 cc -> gcc
lrwxrwxrwx 1 root root 5 Dec 3 18:36 gcc -> gcc32
-rwxr-xr-x 2 root root 102408 Sep 22 2010 gcc34
-rwxr-xr-x 2 root root 266552 Oct 28 2011 gcc44
-rwxr-xr-x 1 root root 2018 Jul 18 2006 gccmakedep
-rwxr-xr-x 2 root root 221920 Oct 27 2011 gcc.orig
lrwxrwxrwx 1 root root 7 Dec 3 18:26 gcc.script -> gcc-4.1
lrwxrwxrwx 1 root root 3 Jul 27 22:03 gnatgcc -> gcc
-rwxr-xr-x 2 root root 266552 Oct 28 2011 x86_64-redhat-linux6E-gcc44
-rwxr-xr-x 2 root root 221920 Oct 27 2011 x86_64-redhat-linux-gcc
-rwxr-xr-x 2 root root 102408 Sep 22 2010 x86_64-redhat-linux-gcc34


[root@gtzjdb bin]# rpm -q gcc
gcc-4.1.2-52.el5
 
Old 12-04-2013, 03:15 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
You seem to be using RHEL (version 5?). How did you install gcc?

Using yum install gcc works on my side of things.

On a RHEL 5.7 box:
Code:
[root@rh5_vm1 ~]# yum install gcc
.
.
.
[root@rh5_vm1 ~]# which gcc
/usr/bin/gcc
[root@rh5_vm1 ~]# rpm -q gcc
gcc-4.1.2-51.el5
[root@rh5_vm1 ~]# cd /usr/bin/
[root@rh5_vm1 bin]# ll | grep gcc
lrwxrwxrwx 1 root root          3 Dec  4 10:09 cc -> gcc
-rwxr-xr-x 2 root root     216032 Apr  7  2011 gcc
-rwxr-xr-x 2 root root     216032 Apr  7  2011 x86_64-redhat-linux-gcc
 
1 members found this post helpful.
Old 12-04-2013, 03:18 AM   #3
inrtyx
LQ Newbie
 
Registered: Dec 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
my server is rhel 5.8. I install gcc when I install linux server.
 
Old 12-04-2013, 03:22 AM   #4
inrtyx
LQ Newbie
 
Registered: Dec 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
You seem to be using RHEL (version 5?). How did you install gcc?

Using yum install gcc works on my side of things.

On a RHEL 5.7 box:
Code:
[root@rh5_vm1 ~]# yum install gcc
.
.
.
[root@rh5_vm1 ~]# which gcc
/usr/bin/gcc
[root@rh5_vm1 ~]# rpm -q gcc
gcc-4.1.2-51.el5
[root@rh5_vm1 ~]# cd /usr/bin/
[root@rh5_vm1 bin]# ll | grep gcc
lrwxrwxrwx 1 root root          3 Dec  4 10:09 cc -> gcc
-rwxr-xr-x 2 root root     216032 Apr  7  2011 gcc
-rwxr-xr-x 2 root root     216032 Apr  7  2011 x86_64-redhat-linux-gcc
my server is rhel 5.8. I install gcc when I install linux server.
 
Old 12-04-2013, 03:43 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by inrtyx View Post
my server is rhel 5.8. I install gcc when I install linux server.
There isn't that much of a difference between 5.7 and 5.8. Newer versions might be used, but that shouldn't be a problem.

Have you tried removing gcc and reinstalling it?
 
Old 12-04-2013, 03:45 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Getting a usable gcc : # yum install gcc-c++

I.e. the gcc-c++ dependencies glibc-devel, glibc-headers, etc.
will also provide full functionality for gcc.


-
 
Old 12-04-2013, 02:29 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
my server is rhel 5.8. I install gcc when I install linux server.
leaving gcc installed on a server is not that good of an idea
reinstall it as needed .Then uninstall it when done


it is like leaving a bag full of "safe cracking tools" NEXT to your safe at work
-- it is begging for trouble

the shortcut "installing only gcc-c++ on 5 works
or the groupinstalls
Code:
su -
yum groupinstall "Development Tools" "Development Libraries"
but double check the spelling from
" yum grouplist"
 
Old 12-04-2013, 11:52 PM   #8
inrtyx
LQ Newbie
 
Registered: Dec 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
There isn't that much of a difference between 5.7 and 5.8. Newer versions might be used, but that shouldn't be a problem.

Have you tried removing gcc and reinstalling it?
[root@gtzjdb data]# rpm -e gcc-4.1.2-52.el5.x86_64
error: Failed dependencies:
gcc = 4.1.2-52.el5 is needed by (installed) gcc-c++-4.1.2-52.el5.x86_64
gcc = 4.1.2-52.el5 is needed by (installed) gcc-gfortran-4.1.2-52.el5.x86_64
gcc = 4.1.2-52.el5 is needed by (installed) gcc-objc-4.1.2-52.el5.x86_64
gcc = 4.1.2-52.el5 is needed by (installed) gcc-gnat-4.1.2-52.el5.x86_64
gcc = 4.1.2-52.el5 is needed by (installed) gcc-java-4.1.2-52.el5.x86_64
gcc is needed by (installed) tog-pegasus-devel-2.11.0-3.el5.x86_64
gcc is needed by (installed) tog-pegasus-devel-2.11.0-3.el5.i386
gcc is needed by (installed) systemtap-1.6-6.el5.x86_64
gcc is needed by (installed) compat-oracle-el5-1.0-5.i386

how to remove gcc?
 
Old 12-05-2013, 01:29 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post # 8.
Quote:
# rpm -e gcc-4.1.2-52.el5.x86_64
You are not supposed to remove the default compiler !

And read post #6 :
gcc will not work unless you also install gcc-c++ ! !

Reinstall goes this way : # yum reinstall gcc

Besides that, the normal remove is : # yum remove <package>

-
 
Old 12-05-2013, 02:35 AM   #10
inrtyx
LQ Newbie
 
Registered: Dec 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Post # 8.

You are not supposed to remove the default compiler !

And read post #6 :
gcc will not work unless you also install gcc-c++ ! !

Reinstall goes this way : # yum reinstall gcc

Besides that, the normal remove is : # yum remove <package>

-
1.I has installed gcc-gcc++.
2.use "yum remove [package]" will also remove dependency package.
3.if I just want to remove gcc.Can you help me?
 
Old 12-05-2013, 03:08 AM   #11
wstewart90
Member
 
Registered: May 2013
Distribution: Arch Linux
Posts: 86

Rep: Reputation: Disabled
yum remove gcc{,-c++}

There's nothing wrong with removing the compiler if you don't plan on compiling anything(It doesn't come standard on RHEL servers anyway) but don't be surprised when you get an error message that says "gcc not found".

Last edited by wstewart90; 12-05-2013 at 03:15 AM.
 
Old 12-05-2013, 03:11 AM   #12
inrtyx
LQ Newbie
 
Registered: Dec 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wstewart90 View Post
Code:
yum remove gcc{,-c++}
There's nothing wrong with removing the compiler if you don't plan on compiling anything(It doesn't come standard on RHEL servers anyway) but don't be surprised when you get an error message that says "gcc not found".
I want to install oracle. gcc is needed?
 
Old 12-05-2013, 03:17 AM   #13
wstewart90
Member
 
Registered: May 2013
Distribution: Arch Linux
Posts: 86

Rep: Reputation: Disabled
Yes it's needed for installing oracle. It's also needed if you plan on keeping gcc-c++. The gcc-c++ package also only adds support for c++ so it' not needed for compiling C code.
 
Old 12-05-2013, 07:08 PM   #14
inrtyx
LQ Newbie
 
Registered: Dec 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wstewart90 View Post
Yes it's needed for installing oracle. It's also needed if you plan on keeping gcc-c++. The gcc-c++ package also only adds support for c++ so it' not needed for compiling C code.
could help me to solve this problem?
 
Old 12-06-2013, 01:35 AM   #15
nishantkharat
LQ Newbie
 
Registered: Jun 2013
Posts: 3

Rep: Reputation: Disabled
#yum install gcc*

try this
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Redhat issue: "bash:gcc command not found" akshit Linux - Newbie 4 02-17-2013 12:54 AM
gcc-4.5.2 - Pass 1 error -gcc command not found ?? adi_30stm Linux From Scratch 20 11-17-2011 12:23 PM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM
bash: gcc: command not found sandbag Linux - Software 8 05-05-2005 12:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration