• yum源配置


    虚拟机下配置yun

    [root@localhost ~]# mkdir /iso
    mount /dev/cdrom /iso
    cd /iso
    ll
    [root@localhost iso]# cd /etc/yum.repos.d/
    [root@localhost yum.repos.d]# ls
    rhel-source.repo
    [root@localhost yum.repos.d]# cp rhel-source.repo iso.repo

    [root@localhost yum.repos.d]# cat iso.repo 
    #yun源的名字,做到全局唯一不重复
    [rhel-iso]
    #注释信息
    name=Red Hat Enterprise Linux $releasever - $basearch - Source
    #yum源的路径,支持三种协议:http、ftp、file,其中file表示本地文件,/iso才是真实路径
    baseurl=file:///iso
    #1表示启用,0表示禁用
    enabled=1
    #指纹校验,为0表示不校验
    gpgcheck=0
    #校验参考的文件
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release

    [root@localhost yum.repos.d]# pwd
    /etc/yum.repos.d
    [root@localhost yum.repos.d]# ll
    total 8
    -rw-r--r--. 1 root root 173 Jul 23 19:09 iso.repo
    -rw-r--r--. 1 root root 529 Apr 28  2011 rhel-source.repo
    #可以测试是否配置成功,还可以进入iso查看是否有文件
    [root@larrywen yum.repos.d]# yum grouplist|grep Devel
      Additional Development
      Desktop Platform Development
      Development tools
      Server Platform Development

    真实机配置本地yum

    [root@larrywen yum.repos.d]#mkdir /iso
    [root@larrywen yum.repos.d]# cp rhel-source.repo iso.repo

    [root@larrywen yum.repos.d]# cat iso.repo 
    #yun源的名字,做到全局唯一不重复
    [rhel-iso]
    #注释信息
    name=Red Hat Enterprise Linux $releasever - $basearch - Source
    #yum源的路径,支持三种协议:http、ftp、file,其中file表示本地文件,/iso才是真实路径
    baseurl=file:///iso
    #1表示启用,0表示禁用
    enabled=1
    #指纹校验,为0表示不校验
    gpgcheck=0
    #校验参考的文件
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

    #本地需要挂载,使用mount命令即可
    [root@larrywen yum.repos.d]# mount
    /home/Wentasy/software/rhel-server-6.1-x86_64-dvd.iso /iso -o loop
    #可以测试是否配置成功,还可以进入iso查看是否有文件
    [root@larrywen yum.repos.d]# yum grouplist|grep Devel
      Additional Development
      Desktop Platform Development
      Development tools
      Server Platform Development

    #mount后重启失效,要想永久生效,添加此句话
    [root@localhost yum.repos.d]# echo "mount /dev/cdrom /iso" >> /etc/rc.local 
    [root@localhost yum.repos.d]# cat /etc/rc.local 
    #!/bin/sh
    #
    # This script will be executed *after* all the other init scripts.
    # You can put your own initialization stuff in here if you don't
    # want to do the full Sys V style init stuff.

    touch /var/lock/subsys/local
    mount /dev/cdrom /iso

  • 相关阅读:
    366. Find Leaves of Binary Tree输出层数相同的叶子节点
    716. Max Stack实现一个最大stack
    515. Find Largest Value in Each Tree Row查找一行中的最大值
    364. Nested List Weight Sum II 大小反向的括号加权求和
    156. Binary Tree Upside Down反转二叉树
    698. Partition to K Equal Sum Subsets 数组分成和相同的k组
    244. Shortest Word Distance II 实现数组中的最短距离单词
    187. Repeated DNA Sequences重复的DNA子串序列
    java之hibernate之基于主键的双向一对一关联映射
    java之hibernate之基于主键的单向一对一关联映射
  • 原文地址:https://www.cnblogs.com/gd-luojialin/p/9216067.html
Copyright © 2020-2023  润新知