install gcc (centos7.3)

  1. autoconf
  2. automake
  3. binutils
  4. bison
  5. flex
  6. gcc
  7. gcc-c++
  8. gettext
  9. libtool
  10. make
  11. patch
  12. pkgconfig
  13. redhat-rpm-config
  14. rpm-build
  15. rpm-sign

Command to list groups on a CentOS / RHEL 7

Type the following yum command:
# yum group list

 

Another option:
# yum group list ids
Sample outputs:

Loaded plugins: fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: mirror01.idc.hinet.net
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
Available Environment Groups:
   Minimal Install (minimal)
   Compute Node (compute-node-environment)
   Infrastructure Server (infrastructure-server-environment)
   File and Print Server (file-print-server-environment)
   MATE Desktop (mate-desktop-environment)
   Basic Web Server (web-server-environment)
   Virtualization Host (virtualization-host-environment)
   Server with GUI (graphical-server-environment)
   GNOME Desktop (gnome-desktop-environment)
   KDE Plasma Workspaces (kde-desktop-environment)
   Development and Creative Workstation (developer-workstation-environment)
Available Groups:
   CIFS file server (cifs-file-server)
   Compatibility Libraries (compat-libraries)
   Console Internet Tools (console-internet)
   Desktop (basic-desktop)
   Desktop Platform (desktop-platform)
   Desktop Platform Development (desktop-platform-devel)
   Development Tools (development)
   Eclipse (eclipse)
   Educational Software (education)
   Electronic Lab (electronic-lab)
   FCoE Storage Client (storage-client-fcoe)
   Fedora Packager (fedora-packager)
   General Purpose Desktop (general-desktop)
   Graphical Administration Tools (graphical-admin-tools)
   Haskell (haskell)
   Legacy UNIX Compatibility (legacy-unix)
   Messaging Client Support (system-management-messaging-client)
   Messaging Server Support (system-management-messaging-server)
   Milkymist (milkymist)
   MySQL Database client (mysql-client)
   MySQL Database server (mysql)
   NFS file server (nfs-file-server)
   Network Storage Server (storage-server)
   SNMP Support (system-management-snmp)
   Scientific Support (scientific)
   Security Tools (security-tools)
   Server Platform (server-platform)
   Server Platform Development (server-platform-devel)
   Smart Card Support (smart-card)
   Storage Availability Tools (storage-client-multipath)
   System Administration Tools (system-admin-tools)
   System Management (system-management)
   TeX support (tex)
   TurboGears application framework (turbogears)
   Virtualization (virtualization)
   Web-Based Enterprise Management (system-management-wbem)
   Xfce (xfce-desktop)
   iSCSI Storage Client (storage-client-iscsi)
Done

Command to install GCC and Development Tools on a CentOS / RHEL 7 server

Type the following yum command as root user:
# yum group install "Development Tools"
OR

$ sudo yum group install "Development Tools"

If above command failed, try:
# yum groupinstall "Development Tools"

A note about failing groupinstall on CentOS/RHEL 7.x

To install all the packages belonging to a package group called “Development Tools” use the following command:
# yum --setopt=group_package_types=mandatory,default,optional groupinstall "Development Tools"
OR
# yum --setopt=group_package_types=mandatory,default,optional group install "Development Tools"

The yum has changed in Red Hat Enterprise Linux 7/CentOS 7. The package group “Development Tools”” has only the optional packages which by default doesn’t get installed. So we will need to pass the option --setopt=group_package_types=mandatory,default,optional to install the optional packages too.

Verify your gcc installation on a CentOS / RHEL 7 server

Type the following command to see gcc location:

$ whereis gcc
gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz

Type the following command to see gcc compiler version:

$ gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Test gcc C compiler with a sample foo.c program

Create a file called foo.c as follows:

#include<stdio.h>
int main(void){
	printf("Hello World!\n");
	return 0;
}

To compile foo.c into foo executable file, type:
$ cc foo.c -o foo
To execute foo program, type:

$ ./foo
Hello World!

A note about install man pages on a CentOS 6/7

Use the yum command as follows:
$ ## [ CentOS 7 ] ##
$ sudo yum install man-pages man-db man
$ ## [ CentOS 6.x ] ##
$ sudo yum install man man-pages

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值