Ask Your Question
1

how to check if gcc it is installed or not?

asked 2013-01-18 14:19:17 -0600

MP gravatar image

updated 2013-01-18 16:14:17 -0600

Jomoos gravatar image

I want to know if I have gcc installed or not. I tried this:

[root@212 ~]# which gcc
/usr/bin/which: no gcc in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

[root@212 ~]# gcc v-
bash: gcc: command not found...
edit retag flag offensive close merge delete

7 Answers

Sort by ยป oldest newest most voted
2

answered 2013-01-19 03:11:54 -0600

ztank1013 gravatar image

@fergatron answer is a good one but it can be improved a little bit by removing the -a option from the rpm command. Using just -q

rpm -q gcc
gcc-4.7.2-2.fc17.x86_64

rpm -q fake-gcc
package fake-gcc is not installed

will give you the full package name if it is installed and "package package-name is not installed" if it is not.

edit flag offensive delete link more
1

answered 2013-01-18 18:01:58 -0600

Elder Marco gravatar image

Just run the following command in a terminal window:

$ gcc --version

The message command not found means you don't have gcc installed.

edit flag offensive delete link more
1

answered 2013-06-15 13:21:59 -0600

gat gravatar image

Entering the following in the commandline as root will show information about the package for gcc. The line "Repo :" will show either a repository or as installed.

yum info gcc

edit flag offensive delete link more

Comments

you don't need to run it as root

Incognito gravatar imageIncognito ( 2013-06-16 02:18:29 -0600 )edit
1

answered 2013-01-18 14:43:50 -0600

fergatron gravatar image

You can try:

rpm -qa gcc

or

yum install gcc

...and see what it says.

edit flag offensive delete link more
0

answered 2015-09-11 13:29:13 -0600

kck gravatar image

while i enter "yum install gcc" it shows "you need to be root to perform this action." How can i root ???

edit flag offensive delete link more
0

answered 2013-06-16 00:07:29 -0600

zhaokun gravatar image

just need use below commond gcc -v

edit flag offensive delete link more
0

answered 2013-06-15 23:21:13 -0600

Incognito gravatar image

updated 2013-06-15 23:40:31 -0600

yum list installed gcc* will show a list of installed gcc packages if any.

yum list gcc* will show a list of available gcc packages, followed by a list of any that might be installed.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-01-18 14:19:17 -0600

Seen: 51,664 times

Last updated: Jun 16 '13