首页 > 系统 > RedHat > 正文

redhat换yum源

2024-06-28 13:26:57
字体:
来源:转载
供稿:网友
redhat换yum源 根据redhat操作系统版本及位数,下载对应centos的版本及位数的这些包:yum-3.2.22-40.el5.centos.noarch.rpmyum-fastestmirror-1.1.16-21.el5.centos.noarch.rpmyum-metadata-parser-1.1.2-4.el5.x86_64.rpm1.先安装yum-metadata-parser-1.1.2-4.el5.x86_64.rpm:rpm -ivhyum-metadata-parser-1.1.2-4.el5.x86_64.rpm2.同时安装yum-3.2.22-40.el5.centos.noarch.rpm、yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpmrpm -ivhyum-3.2.22-40.el5.centos.noarch.rpmyum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm3.获取163yum:wgethttp://mirrors.163.com/.help/CentOS-Base-163.repo文件内容替换:把CentOS-Base-163.repo文件中的“$releasever”,替换成“5”(5为系统的版本号。) vi CentOS-Base-163.repo :% s//$releasever/5/g

[base]

name=CentOS-$releasever-Base

baseurl=http://mirrors.163.com/centos/6.3/os/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

#releasedupdates

[updates]

name=CentOS-$releasever-Updates

baseurl=http://mirrors.163.com/centos/6.3/updates/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

#packagesused/PRoducedinthebuildbutnotreleased

#[addons]

#name=CentOS-$releasever-Addons

#baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/

#gpgcheck=1

#gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

#additionalpackagesthatmaybeuseful

[extras]

name=CentOS-$releasever-Extras

baseurl=http://mirrors.163.com/centos/6.3/extras/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

#additionalpackagesthatextendfunctionalityofexistingpackages

[centosplus]

name=CentOS-$releasever-Plus

baseurl=http://mirrors.163.com/centos/6.3/centosplus/$basearch/

gpgcheck=1

enabled=0


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表