• yum 在 rhel 6.x 下的本地配置


    yum 安装软件远比 rpm 使用方便,下面简单描述下 rhel 6.x 的yum 配置 

    # cd /mnt
    # mkdir cdrom
    # mount /dev/cdrom /mnt/cdrom

    # cat /etc/yum.conf 
    [main]
    cachedir=/var/cache/yum/$basearch/$releasever
    keepcache=0
    debuglevel=2
    logfile=/var/log/yum.log
    exactarch=1
    obsoletes=1
    gpgcheck=1
    plugins=1
    installonly_limit=3


    #  This is the default, if you make this bigger yum won't see if the metadata
    # is newer on the remote and so you'll "gain" the bandwidth of not having to
    # download the new metadata and "pay" for it by yum not having correct
    # information.
    #  It is esp. important, to have correct metadata, for distributions like
    # Fedora which don't keep old packages around. If you don't like this checking
    # interupting your command line usage, it's much better to have something
    # manually check the metadata once an hour (yum-updatesd will do this).
    # metadata_expire=90m


    # PUT YOUR REPOS HERE OR IN separate files named file.repo
    # in /etc/yum.repos.d


    红色背景说明有两个方法配置yum源,第一种是在 /etc/yum.conf 末尾直接添加,

    第二种是在 /etc/yum.repos.d/ 目录下创建 .repo 文件。


    第一种方法:

    # vi /etc/yum.conf

    追加如下内容

    [base]
    name=base yum 
    baseurl=file:///mnt/cdrom
    gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release

    [updates-released]
    name= updates-released yum 
    baseurl=file:///mnt/cdrom
    gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release



    第二种方法: 
    # cd /etc/yum.repos.d/
    # cp rhel-source.repo  rhel-source.repo.bak
    # vi rhel-source.repo

    [rhel-source]
    name=Red Hat Enterprise Linux $releasever - $basearch - Source
    baseurl=file:///mnt/cdrom
    enabled=1
    gpgcheck=0
    gpgkey=file:///etc/cdrom/RPM-GPG-KEY-redhat-release


    [rhel-source-beta]
    name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
    baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

  • 相关阅读:
    ORA12518 TNS:监听程序无法分发客户机连接的解决办法
    纯css手风琴效果
    css2实现尖角箭头式导航
    html+css基础
    iOS开发之压缩与解压文件
    一种简便的ios图片加密方法对图片进行base64编码
    将自己的应用程序显示在报刊杂志中
    [转]苹果iOS 5限制应用本地存储问题
    [转]苹果开发者帐号(Company)申请流程
    [转]IOS6.0框架及功能更新小结
  • 原文地址:https://www.cnblogs.com/ctypyb2002/p/9793165.html
Copyright © 2020-2023  润新知