zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    k8s之docker被屏蔽后下载方法
    代码合并工具Beyond Compare的使用技巧
    (转)设计模式——观察者模式
    notepad问题汇总
    个人构建问题
    内部git常用总结
    (转)动态规划算法—买卖股票的最佳时机系列
    (转)java中引用传递和值传递
    互联网面试题
    (转)UML类图与类的关系详解
  • 原文地址:https://www.cnblogs.com/ctypyb2002/p/9793165.html
Copyright © 2011-2022 走看看