LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-11-2010, 09:33 AM   #1
kenneth2078
LQ Newbie
 
Registered: Aug 2009
Posts: 9

Rep: Reputation: 0
Question gcc installation problem


Hi,guys
The command m -qa | grep gcc points out that the gcc have been installed.

Use 'which gcc' shows gcc in the path /usr/lib/ccache/gcc ,and more a file named gcc under /usr/bin .

But i can't use gcc , gcc -v command says that no such file or directory. what's wrong with it, please help.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-11-2010, 09:50 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,536

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
Fedora : 1) su

2) yum install gcc gcc-c++ glibc-headers glibc-devel

.. will install gcc and the files required to use it.


rpm -qa | grep <package-name> ( or part of name )
is telling, what is installed.

( Only /usr/bin/gcc will be usable, and then only if you
also have the two "glibc" development packages mentioned.)
.....
 
Old 02-11-2010, 11:11 AM   #3
kenneth2078
LQ Newbie
 
Registered: Aug 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
Fedora : 1) su

2) yum install gcc gcc-c++ glibc-headers glibc-devel

.. will install gcc and the files required to use it.


rpm -qa | grep <package-name> ( or part of name )
is telling, what is installed.

( Only /usr/bin/gcc will be usable, and then only if you
also have the two "glibc" development packages mentioned.)
.....
Hi, I do it as you wrote above, but still the gcc isn't work .

By the way i made the gcc file under /usr/bin/ by ln -s /usr/lib/ccache/gcc, which may lead to the problem , i guess.
 
Old 02-11-2010, 11:44 AM   #4
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by kenneth2078 View Post
what's wrong with it, please help.
What is the output of "echo $PATH"? Is "/usr/bin" in your path?
 
Old 02-11-2010, 12:47 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,536

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
And ccache is not the compiler ( /usr/lib/ccache/* ) :
ccache is a compiler cache. It acts as a caching pre-processor
to C/C++ compilers, using the -E compiler switch and a hash to
detect when a compilation can be satisfied from cache. This
often results in a 5 to 10 times speedup in common compilations.
( ccache-2.4-16.fc12.i686 )

So please delete the link, you made.

1) echo $PATH , as said by @ David1357
2) Try this command : /usr/bin/gcc -v
3) And show the output from : rpm -qa gcc
.....
 
Old 02-11-2010, 10:01 PM   #6
kenneth2078
LQ Newbie
 
Registered: Aug 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by David1357 View Post
What is the output of "echo $PATH"? Is "/usr/bin" in your path?

echo $PATH output: /usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/sbin: /usr/local/bin:/sbin:/bin:/usr/bin:/usr/lib/ccahce/:/root/bin
 
Old 02-11-2010, 10:08 PM   #7
kenneth2078
LQ Newbie
 
Registered: Aug 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
And ccache is not the compiler ( /usr/lib/ccache/* ) :
ccache is a compiler cache. It acts as a caching pre-processor
to C/C++ compilers, using the -E compiler switch and a hash to
detect when a compilation can be satisfied from cache. This
often results in a 5 to 10 times speedup in common compilations.
( ccache-2.4-16.fc12.i686 )

So please delete the link, you made.

1) echo $PATH , as said by @ David1357

2) Try this command : /usr/bin/gcc -v
No such file or directory

3) And show the output from : rpm -qa gcc
gcc-4.3.0-8.i386

.....
please see my reply in red.
 
Old 02-11-2010, 10:10 PM   #8
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Debian, SL
Posts: 5,196

Rep: Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120
What about

Code:
file /usr/bin/gcc
Evo2.
 
Old 02-11-2010, 11:09 PM   #9
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Please post your distro & version.
In any case seems like an rpm based system, so try this

yum groupinstall "Development Tools"

from http://www.cyberciti.biz/faq/rhel-ce...command-howto/. you may need the groupremove option there first. I'd also remove that symlink first as noted above.

IOW:

1. remove symlink
2. yum groupremove "Development Tools"
3. yum clean all
4. yum groupinstall "Development Tools"
 
2 members found this post helpful.
Old 02-12-2010, 03:13 AM   #10
kenneth2078
LQ Newbie
 
Registered: Aug 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by evo2 View Post
What about

Code:
file /usr/bin/gcc
Evo2.
/usr/bin/gcc:ERROR:can not open '/usr/bin/gcc',no such file or directory.
And I once had deleted the gcc file in /usr/bin, if the the correct gcc rebuilt, the problem would be solved.
 
Old 02-12-2010, 03:26 AM   #11
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Debian, SL
Posts: 5,196

Rep: Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120
Quote:
Originally Posted by kenneth2078 View Post
/usr/bin/gcc:ERROR:can not open '/usr/bin/gcc',no such file or directory.
And I once had deleted the gcc file in /usr/bin, if the the correct gcc rebuilt, the problem would be solved.
Hmm, I suggest you reinstall the package.

EDIT: Follow steps 2 - 4 in chrism01 post #9

Evo2.

Last edited by evo2; 02-12-2010 at 03:34 AM.
 
Old 02-12-2010, 06:18 AM   #12
kenneth2078
LQ Newbie
 
Registered: Aug 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by evo2 View Post
Hmm, I suggest you reinstall the package.

EDIT: Follow steps 2 - 4 in chrism01 post #9

Evo2.
Your are right.!!
 
  


Reply

Tags
gcc


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
[SOLVED] Gcc Installation problem malickhat Linux - Newbie 18 11-05-2009 06:41 AM
gcc installation problem ajaytiwary Linux - Newbie 8 10-18-2007 06:45 AM
GCC installation problem nicky43 Linux - Software 3 07-22-2006 05:59 AM
Problem with installation of gcc 3.4.3 lxeye Programming 5 01-16-2005 11:03 AM
Gcc installation problem Agileuk Linux - Newbie 2 09-28-2003 06:11 PM


All times are GMT -5. The time now is 09:34 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration