• 配置yum源


    1.确保RHEL5中已经安装了yum

    [root@lvs-master ~]# rpm -qa |grep yum
    yum-metadata-parser-1.1.2-3.el5
    yum-updatesd-0.9-2.el5
    yum-3.2.22-26.el5
    yum-security-1.1.16-13.el5
    yum-rhn-plugin-0.5.4-15.el5

    2.修改源配置文件 #vim /etc/yum.repos.d/CentOS-Base.repo

    [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

    # vi dag.repo
    [dag]
    name=Dag RPM Repository for RHEL5
    baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/
    enabled=1
    gpgcheck=1
    gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt

    3. 导入key 
     #rpm --import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

    4. 运行,测试 
     #yum update

    5.#yum clean all

    方法二:

    # cd /etc/yum.repos.d/
    #mv CentOS-Base.repo CentOS-Base.repo.bak
    #wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo

    该文件内容如下:

    [base]
    name=CentOS-5 - Base
    baseurl=http://centos.ustc.edu.cn/centos/5/os/$basearch/
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

    #released updates
    [update]
    name=CentOS-5 - Updates
    baseurl=http://centos.ustc.edu.cn/centos/5/updates/$basearch/
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

    #packages used/produced in the build but not released
    [addons]
    name=CentOS-5 - Addons
    baseurl=http://centos.ustc.edu.cn/centos/5/addons/$basearch/
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
    #additional packages that may be useful
    [extras]
    name=CentOS-5 - Extras
    baseurl=http://centos.ustc.edu.cn/centos/5/extras/$basearch/
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-5 - Plus
    baseurl=http://centos.ustc.edu.cn/centos/5/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-5 - Contrib
    baseurl=http://centos.ustc.edu.cn/centos/5/contrib/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

    #packages in testing
    [testing]
    name=CentOS-5 - Testing
    baseurl=http://centos.ustc.edu.cn/centos/5/testing/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  • 相关阅读:
    Serverless 解惑——函数计算如何安装字体
    构建安全可靠的微服务 | Nacos 在颜铺 SaaS 平台的应用实践
    OAM v1alpha2 新版:平衡标准与可扩展性
    人工智能与阅读能力的关系研究
    Java Web每天学之Servlet的原理解析
    ThreadLocal类的简单使用
    JavaScript之DOM创建节点
    css浮动(float)及清除浮动的几种实用方法
    Apache Sentry部署
    Spark机器学习解析下集
  • 原文地址:https://www.cnblogs.com/Ycc9/p/5408969.html
Copyright © 2020-2023  润新知