RedHat6安装yum(gcc编译器)

1.卸载原有的yum及相关软件包

rpm -qa | grep yum | xargs rpm -e --nodeps
rpm -qa |grep python-urlgrabber|xargs rpm -e --nodeps

2下载yum相关软件包

下载地址:(http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/)
python-urlgrabber-3.9.1-11.el6.noarch.rpm
python-iniparse-0.3.1-2.1.el6.noarch.rpm
yum-3.2.29-81.el6.centos.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.x86_64 .rpm
yum-plugin-fastestmirror-1.1.30-41.el6.noarch .rpm

3.安装软件包

rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm yum-3.2.29-73.el6.centos.noarch.rpm

4.配置yum仓库

cd/etc/yun.repos.d/

vim centos.repo

在vi编辑器下输入配置

[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
gpgcheck=1
enabled=0
           

5.测试

yum install gcc

然后就可以用gcc编译写过的C程序啦。

你可能感兴趣的:(RedHat6安装yum(gcc编译器))