1. 程式人生 > >redhat7.2配置yum源

redhat7.2配置yum源

也適用於其他版本的redhat

只需做3步操作:

第1步:建立檔案/etc/yum.repos.d/rhel-debuginfo.repo並寫入

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

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

[extras] name=CentOS-$releasever - Extras baseurl=http://mirrors.163.com/centos/7/extras//$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

[centosplus] name=CentOS-$releasever - Plus baseurl=http://mirrors.163.com/centos/7/centosplus//$basearch/ gpgcheck=1 enabled=0 第2步:

     yum clean all 

第3步:

    yum update  

配置完畢!

================================================================================================

注意如果是其他版本,只需要找到對應的映象就可以裡:

例如 redhat 6.7

[base] name=CentOS-$releasever - Base baseurl=http://mirrors.163.com/centos/6/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/6/os/x86_64/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/6/os/x86_64/RPM-GPG-KEY-CentOS-6 

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

[centosplus] name=CentOS-$releasever - Plus baseurl=http://mirrors.163.com/centos/6/centosplus//$basearch/ gpgcheck=1 enabled=0