Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-24-2009, 06:34 AM   #1
LQ Newbie
Registered: Jul 2009
Posts: 13

Rep: Reputation: 0
gcc versions installed on my system and which one is default..??

I am very new to linux and have been working on a system not configured or installed by me..and i am supposed to know how many versions of gcc are installed on my system and which one is the default one..??..
any way out to this problem...
Thanks All
-MuHaMMeD Salman
Old 07-24-2009, 07:11 AM   #2
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
I don't know about multiple versions, but have you tried `gcc -v`?
Old 07-24-2009, 07:27 AM   #3
Senior Member
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,254

Rep: Reputation: 145Reputation: 145
how many versions of gcc are installed on my system and which one is the default one..??..
#rpm -qa | grep gcc
it will output all rpms which are related to gcc and version
Old 07-24-2009, 12:50 PM   #4
John VV
LQ Muse
Registered: Aug 2005
Posts: 15,894

Rep: Reputation: Disabled
what is the distro and version? that would help
fedora 11 uses gcc version 4.4.0 20090506 (Red Hat 4.4.0-4) (GCC)
RHEL 5.3 uses gcc 4.3 ? or is it 4.2
Old 07-24-2009, 01:26 PM   #5
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,279

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
Originally Posted by salmanmanekia View Post
i am supposed to know how many versions of gcc are installed on my system
That might be very difficult. There is a lot of flexibility when installing gcc from source. You can easily customize its name and/or location to install a version of gcc that you can use on demand without conflicting with the default version or other extra versions.

The many versions of gcc on the systems where I work are in strange automounts across the network, so they aren't in the database used by locate and some of the auto mount directories seem to be invisible to wild cards until explicitly accessed. So on my system finding the gcc executables at all would be hard if I didn't know where to look.

But on a less strange system, I expect the main executable for any version of gcc is likely to have "gcc" as part of its name. It shouldn't be too hard to run a search for all files that have "gcc" in their name (likely to be quite a lot) and automatically run "file" for each to filter for just the ones that are ordinary executables (which should be a more manageable list) and then just look at the list and guess/test (should be easy) which are the main executables of installed versions of gcc.

and which one is the default one..??..
But that ought to be easy. As karamarisan said
gcc -v

Last edited by johnsfine; 07-24-2009 at 01:36 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Link Error: Two versions of boost installed on system simulacrum111 Programming 1 07-19-2009 07:24 PM
default gcc installed from hardy cd does not produce executables raphtor Linux - Newbie 6 12-30-2008 06:37 PM
GCC not installed by default in SUSE 10.1? *Xenny* SUSE / openSUSE 3 08-07-2006 10:02 AM
Is it possible to have two different versions of GCC in the same system ?? nasty_daemon Linux - Software 2 09-07-2005 11:49 AM
Can you have two different versions of gcc on the same system? the theorist Linux - Software 1 02-23-2004 05:53 PM

All times are GMT -5. The time now is 08:37 PM.

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