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 - $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

Centos yum国内源及配置含义的更多相关文章

  1. CentOS 7 国内源配置

    CentOS 7 国内源配置 1. 备份自带源 # 首先要确认你有 wget 命令, 并且连着网 # cd /etc/yum.repos.d/ # mkdir repo # mv *.repo rep ...

  2. 在Kali linux下使用docker配置sqli-labs(国内源的配置和系统软件更新)

    本篇blog导航: ~前言 ~第一步:在安装好的kali配置国内源 ~第二步:安装docker ~第三步:docker下安装sqli-labs ~写在最后. 前言: 最近闲来无事,在闯关sqli-la ...

  3. (实用)Ubuntu 、CentOS更换国内源

    Ubuntu更换apt-get源 通过编辑/etc/apt/sources.list文件,我们能够更换Ubuntu的默认软件更新源.通常是将其换成一些国内比较知名的源.本文主要列举这些内容. 注意,在 ...

  4. fedora国内源常见配置

    yum install yum-fastestmirror3.rpmfusion源 rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfus ...

  5. centos yum 安装jdk后配置JAVA_HOME

    centos6.4 yum 安装jdk和JAVA_HOME的设置 2014-06-17 16:13 1176人阅读 评论(0) 收藏 举报  分类: linux(3)  版权声明:本文为博主原创文章, ...

  6. [转]fedora国内源常见配置

    1.参考:1.http://mirrors.ustc.edu.cn/2.http://mirrors.fedoraproject.org/publiclist#CN3.http://mirrors.n ...

  7. pip使用国内源的配置方法

    [root@ ~]# cat ~/.pip/pip.conf [global] index-url = https://pypi.douban.com/simple

  8. pip 国内源 包管理

    配置国内源 linux配置 修改 ~/.pip/pip.conf 文件,如下,添加了源并修改了默认超时时间 [global] timeout = 3000 index-url = http://mir ...

  9. CentOS 配置国内源

    阿里云Linux安装镜像源地址:http://mirrors.aliyun.com/ CentOS系统更换软件安装源 第一步 备份你的原镜像文件,以免出错后可以恢复. mv /etc/yum.repo ...

随机推荐

  1. redis监控脚本

    while [ 1 == 1 ]  ; do   now=$(date "+%Y-%m-%d_%H:%M:%S")  ; echo "================== ...

  2. Flask--Web From 表单

    需要拓展支持 1.Flask-WTF是WTForms项目的Flask框架扩展,我们将用他来帮助我们处理web表单 2.pip install Flask-WTF 配置WTF(不知道为什么,但是好像必须 ...

  3. youDao

    2018-09-22Journeys end in lovers' meeting.漂泊止于爱人的相遇. All extremes of feeling are allied with madness ...

  4. Python上下文管理器 with

    对于系统资源的操作,如:文件操作.数据库操作等,我们往往打开文件.连接数据库后忘了将其close掉,这时就可能会引发异常,因此我们常用的做法是: # coding:utf-8 f = open(&qu ...

  5. mysql order by多个字段

    Mysql order by 多字段排序 mysql单个字段降序排序: select * from table order by id desc; mysql单个字段升序排序: select * fr ...

  6. python基础篇_002_基础数据类型

    Python基础数据类型 1.int # int 用于计算 num = 3 # int 与其他数据类型转换 int_to_str = str(num) # 数字加引号 print(int_to_str ...

  7. SVM:随机产生100个点,建立模型,找出超平面方程——Jaosn niu

    import numpy as np import pylab as pl from sklearn import svm # we create 40 separable points #np.ra ...

  8. BroadcastReceiver插件化解决方案

    --摘自<android插件化开发指南> 1.静态广播和动态广播仅区别于注册方式的不同.静态广播的注册信息保存在PMS中,动态广播的注册信息保存在AMS中 2.发送广播,也就是Contex ...

  9. HDU1029 Ignatius and the Princess IV (水题)

    <题目链接> 题目大意:给你一段序列,问你在这个序列中出现次数至少为 (n+1)/2 的数是哪个. 解题分析: 本题是一道水题,如果用map来做的话,就非常简单,但是另一个做法还比较巧妙. ...

  10. Django之第三方登陆模块

    Django之第三方登陆模块 前期准备 安装 django-allauth pip install django-allauth 注意,django-allauth 需要在 Django1.10以上版 ...