zoukankan      html  css  js  c++  java
  • Centos yum国内源及配置含义

    Centos yum源的位置:

    /etc/yum.repos.d,可以通过配置文件/etc/yum.conf指定其他位置

    主要的yum源种类:前两个是必须的,不然yum安装很多软件时会失败。yum本来是智能解决软件之间的依赖,但是如果源太少,就导致查不到所需依赖。

    • epel
    • CentOS-Base
    • nginx:http://nginx.org/en/linux_packages.html#RHEL-CentOS
    • Remi源:centos7、centos6

      rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-7.rpm
      rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-6.rpm
      
    • 有些软件使用yum安装,需要先找到并指定这个软件的yum源

    epel源安装:

    安装完成之后会在目录/etc/yum.repos.d生成epel.repo

    yum -y install epel-release
    yum clean all  # 清除系统所有的yum缓存
    yum makecache  # 生成yum缓存

    导入相应的key,不然安全某些软件时会校验失败:
    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

    安装时不校验:

    yum install xx --nogpgcheck

    gpgcheck=0

    rpm -i --nosignature

     
     

    切换到国内源:以阿里源举例

    wget http://mirrors.aliyun.com/repo/Centos-7.repo

    wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo # 下载阿里开源镜像的epel源文件

    国内源:

    网易镜像源:http://mirrors.163.com/.help/centos.html

    阿里镜像源:https://opsx.alibaba.com/mirror?lang=zh-cn

    repo文件含义:

    [epel]
    name=Extra Packages for Enterprise Linux 7 - $basearch
    #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch  # 源地址
    metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch # 源地址
    failovermethod=priority
    enabled=1  #  是否开启这个源
    gpgcheck=1   # 是否校验这个源
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 # 校验文件的位置

    参考:

    https://blog.csdn.net/inslow/article/details/54177191

    https://www.jianshu.com/p/d2ecad045c54

    https://blog.51cto.com/xiaocao13140/2105528

  • 相关阅读:
    ajax全套
    url设计规范
    内置下划线方法
    rest_framework视图
    rest_framework
    数据库设置
    HDU 6231
    HDU 6242
    CodeForces 546D
    CodeForces 940E
  • 原文地址:https://www.cnblogs.com/shengulong/p/10561735.html
Copyright © 2011-2022 走看看