zoukankan      html  css  js  c++  java
  • 解决在CentOS 5.5 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

  • 相关阅读:
    free解释
    无损 JBIG2 编码库(Lossless JBIG2 Encoder)
    PDF补丁丁暂停更新
    PDF补丁丁将字符识别结果写入PDF文件功能即将完成
    PDF补丁丁0.3.3版:字符识别结果写入PDF文件功能邀请测试
    PDF补丁丁 0.3.3.58版修复打开、输出超大型PDF文件问题
    PDF补丁丁0.3.3版即将发布
    PDF补丁丁0.3.3.12 新增查看PDF文件隐藏对象及导出流对象功能
    PDF 补丁丁 0.3.3 正式版发布
    PDF 补丁丁0.3.3.20版新增JBIG2压缩功能,可为扫描PDF瘦身
  • 原文地址:https://www.cnblogs.com/codebean/p/2059900.html
Copyright © 2011-2022 走看看