`

修改CentOS yum源

 
阅读更多
解决在CentOS yum源下载慢的办法


最近在虚拟机下面安装了个CentOS 5.5,使用yum更新时发现下载速度异常慢。可以修改yum的配置文件,把其镜像指向国内的服务器即可。
方案一:
# cd /etc/yum.repos.d/
# mv CentOS-Base.repo CentOS-Base.repo.bak
# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
方案二:
手段修改CentOS-Base.repo文件,将baseurl设置成baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/
详细配置如下:


[base]


name=CentOS-5-Base


#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&repo=os


#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/


baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/


gpgcheck=1


gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5


#released updates


[update]


name=CentOS-5-Updates


#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates


baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/


gpgcheck=1


gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5


#packages used/produced in the build but not released


[addons]


name=CentOS-5-Addons


#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons


baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/


gpgcheck=1


gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5


#additional packages that may be useful


[extras]


name=CentOS-5-Extras


#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras


baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/


gpgcheck=1


gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5


#additional packages that extend functionality of existing packages


[centosplus]


name=CentOS-5-Plus


#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus


baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/


gpgcheck=1


enabled=0


gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5


#contrib – packages by Centos Users


[contrib]


name=CentOS-5-Contrib


#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib


baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/


gpgcheck=1


enabled=0


gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5


导入 key
# rpm –import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
运行,测试
# yum update
全部删除临时文件

#yum clean all


原文地址:http://www.cnblogs.com/codebean/archive/2011/05/27/2059900.html

分享到:
评论

相关推荐

    修改centos的yum源为阿里云

    修改linux操作系统 修改centos系统的yum源为阿里云详解

    修改red hat yum 源为centos

    将red hat 7.3或7.4的yum源改为 Centos 的yum源。文件放一起。要root

    linux redhat centos修改yum下载源.zip_redhat yum源

    linux redhat centos修改yum下载源.zip

    centos7搭建KVM、VNC、yum源修改

    关于centos7搭建KVM虚拟化、VNCserver安装调试、yum源修改方法;

    redhat6.5修改yum源

    内含需要安装的rpm包和修改后的yum源配置。 python-urlgrabber-3.9.1-11.el6.noarch.rpm yum-3.2.29-40.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.i686.rpm yum-metadata-parser-1.1.2-16.el6.x86_64...

    配置网易Centos的yum源

    用于配置Centos和redhat的yum源仓库,包含下载地址,以及repo内容的修改,可以为初学者提供一个使用yum的机会

    CENTOS-YUM源包

    在未注册的redhat6.5下有可能用不了yum命令去在线安装一些包,这时需要通过安装,修改yum源来支持。

    RedHat 5.4yum源修改

    将redhat linux下收费yum源改为centos免费Yum源 有上网找的yum源软件包下载地址,直接就可以用

    Centos7同步阿里yum仓库搭建yum私有仓库

    1.修改yum源仓库 [root@mini2 /]# rm -rf /etc/yum.repos.d/* [root@mini2 /]# wget -O /etc/yum.repos.d/base.repo http://mirrors.aliyun.com/repo/Centos-7.repo //base源 [root@mini2 /]# wget -O /etc/yum....

    Centos7.4离线本地yum源自动化安装CDH5.13.0脚本

    使用说明: 1、 请仔细阅读脚本内容是否真实符合本地...1、本脚本已经在生产环境真实部署,请根据实际情况进行修改 2、本脚本为本人亲自编写,如有不当之处或改进之处请在评论指正,本着分享原则分享出来,共同进步

    centos6的网络源

    centos6的网络源,直接放到/etc/yum.repo.d/下 ,无需修改其他东西 直接可以使用 良心东西 童叟无欺~~

    Centos系统更改yum源为163

    Centos安装好之后,按照网上教程对yum源进行修改,但更新之后发现总是提示更新失败,发现其中一些是有错误的,下面是我修正后的,有待完善。 请参考 1、进入存放源配置的文件夹  cd /etc/yum.repos.d 2、备份默认源...

    CentOS系统yum源配置修改、yum安装软件包源码包出错解决办法!-附件资源

    CentOS系统yum源配置修改、yum安装软件包源码包出错解决办法!-附件资源

    yum源gcc安装文档.doc

    修改yum配置文件 vim /etc/yum.repos.d/dvd.repo //建立dvd.repo Vim打开后按“i”插入,把以下代码写到文件里。按“shift+: wq”保存退出 [dvd] //dvd配置名 name=install dvd baseurl=file:///redhat/Server //...

    详解centos7配置本地yum源的方法

    2、修改yum源配置 yum源配置目录为“/etc/yum.repo.d/”,网络不可用,所以直接删除掉里面的默认配置“rm -f *”,然后建立本地yum源文件”local.repo”。 yum源配置文件都是以repo结尾,以下是local.repo的具体...

    Redhat5yum源.tar.gz

    CentOS 5 在2017-03-31日已经结束...2.修改源配置文件 rhel-source.repo.bak。3. 导入key rpm --import RPM-GPG-KEY-CentOS-5。4.清理yum缓存 yum clean all && yum makecache。5.测试yum yum repolist all /yum list

    rhel7 替换为CentOS源文件

    此文档为RHEL7的yum源替换为免费CentOS的yum源所需包。

    yum本地源装载gcc、gcc-c++、cmake(含配置文件及初始化shell)

    二、修改CentOS-Media.repo中:baseurl=file:///app/iso/为上传文件所在目录 三、执行yum_init.sh后 即可运行yum install 了 ================================================== 注:文件名称iyum.zip无毒手工...

    Centos-6.repo

    修改yum源 Centos-6.repo; 修改yum源 Centos-6.repo; 修改yum源 Centos-6.repo;

Global site tag (gtag.js) - Google Analytics