centos7 制作yum源
一、依赖
1.rsync
yum install -y rsync xinetd
2.nginx,这个就不多说了
二、建立目录
mkdir -p /data/yum_source/nginx/html/centos mkdir -p /data/yum_source/nginx/html/repoforge mkdir -p /data/yum_source/nginx/html/epel
三、去除同步列表
touch exclude_centos.list #创建文件 touch exclude_repoforge.list #创建文件 touch exclude_epel.list #创建文件 把不需要同步的目录写到上面对应的文件中,每行一个目录 例如: vi exclude_epel.list / 4AS/ 4ES/ 4WS/ :wq! #保存退出
四、源
三个yum源上游源的同步镜像地址 、CentOS官方标准源:rsync://mirrors.ustc.edu.cn/centos/ 、rpmforge源:rsync://mirrors.ispros.com.bd/repoforge/ 、epel源:rsync://mirrors.ustc.edu.cn/epel/
五、同步脚本
mkdir -p /data/yum_source/command echo '#!/bin/sh /usr/bin/rsync -avrt rsync://mirrors.ustc.edu.cn/centos/ --exclude-from=/data/yum_source/nginx/html/exclude_centos.list /data/yum_source/nginx/html/centos/ /usr/bin/rsync -avrt rsync://mirrors.ispros.com.bd/repoforge/ --exclude-from=/data/yum_source/nginx/html/exclude_repoforge.list /data/yum_source/nginx/html/repoforge/ /usr/bin/rsync -avrt rsync://mirrors.ustc.edu.cn/epel/ --exclude-from=/data/yum_source/nginx/html/exclude_epel.list /data/yum_source/nginx/html/epel/' > /data/yum_source/command/sync.sh
六、执行同步
nohup sh /data/yum_source/command/sync.sh &
七、检查
tail -f nohup.out
八、配置系统使用搭建的源
1.CentOS官方标准源:
######################### CentOS .x系列: vi /etc/yum.repos.d/CentOS-Base.repo #添加以下代码 # CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os baseurl=http://192.168.21.188/centos/$releasever/os/$basearch/ gpgcheck= gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates baseurl=http://192.168.21.188/centos/$releasever/updates/$basearch/ gpgcheck= gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras baseurl=http://192.168.21.188/centos/$releasever/extras/$basearch/ gpgcheck= gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus baseurl=http://192.168.21.188/centos/$releasever/centosplus/$basearch/ gpgcheck= enabled= gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-7 :wq! #保存退出 #########################
2.rpmforge源:
######################### CentOS .x系列: vi /etc/yum.repos.d/rpmforge.repo #添加以下代码 [rpmforge] name = RHEL $releasever - RPMforge.net - dag baseurl = http://192.168.21.188/repoforge/redhat/el7/en/$basearch/rpmforge enabled = protect = gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = [rpmforge-extras] name = RHEL $releasever - RPMforge.net - extras baseurl = http://192.168.21.188/repoforge/redhat/el7/en/$basearch/extras enabled = protect = gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = [rpmforge-testing] name = RHEL $releasever - RPMforge.net - testing baseurl = http://192.168.21.188/repoforge/redhat/el7/en/$basearch/testing enabled = protect = gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = :wq! #保存退出 #########################
3.epel源:
######################### CentOS .x系列: vi /etc/yum.repos.d/epel.repo #添加以下代码 [epel] name=Extra Packages - $basearch baseurl=http://192.168.21.188/epel/beta/7/$basearch failovermethod=priority enabled= gpgcheck= gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-7 [epel-debuginfo] name=Extra Packages - $basearch - Debug baseurl=http://192.168.21.188/epel/beta/7/$basearch/debug failovermethod=priority enabled= gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-7 gpgcheck= [epel-source] name=Extra Packages - $basearch - Source baseurl=http://192.168.21.188/epel/beta/7/SRPMS failovermethod=priority enabled= gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-7 gpgcheck= :wq! #保存退出 #########################
centos7 制作yum源的更多相关文章
- [转]centos7 修改yum源为阿里源
centos7 修改yum源为阿里源,某下网络下速度比较快 首先是到yum源设置文件夹里 cd /etc/yum.repos.d 接着备份旧的配置文件 sudo mv CentOS-Base.repo ...
- centos7 修改yum源为阿里源
centos7 修改yum源为阿里源,某下网络下速度比较快 首先是到yum源设置文件夹里 安装base reop源 cd /etc/yum.repos.d 接着备份旧的配置文件 sudo mv Cen ...
- [问题解决]RedHat7更换CentOS7的yum源时踩过的坑
更换yum源的流程 查看当前yum程序 $ rpm -qa|grep yum 这里推荐将其结果截屏或拷贝出来,以免后面报错修复. 删除原有yum源 $ rpm -aq | grep yum|xargs ...
- Linux 使用系统ISO制作yum源
关于linux安装问题,大多数情况下 系统开发完成之后,需要部署到生产机器上,客户提供的机器预装好了操作系统,但是都是内网环境 与外网都是物理隔绝的,那么 在搭建生产环境时需要安装相关软件时,如果自己 ...
- Linux 永久挂载镜像文件和制作yum源
Linux mount命令是经常会使用到的命令,它用于挂载Linux系统外的文件. 1.镜像挂载到系统指定目录下:[root@master cdrom]# mount -t auto /mnt/c ...
- 修改Centos7的yum源
以下为修改Centos7的yum源: 1. 备份原镜像文件,便于后期恢复 [root@keepmydream ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc ...
- CentOS7搭建yum源仓库(阿里源)
文章目录 注意:环境要求 1.配置服务器端yum 1.1.安装yum源工具 1.2.配置nginx 1.2.1.配置nginx页面目录 1.3.替换yum源文件 1.4.建立yum源仓库 2.配置客户 ...
- Centos7修改yum源
1. 备份本地yum源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak 2.获取阿里yum源配置文 ...
- CentOS7 设置yum源
1.关闭防火墙 临时关闭防火墙 systemctl stop firewalld 永久防火墙开机自关闭 systemctl disable firewalld 临时打开防火墙 systemctl st ...
随机推荐
- HTML/CSS基础知识(四)
WEB标准和W3C的理解与认识 Web标准是一系列标准的集合. 网页主要由三部分组成:结构(Structure).表现(Presentation)和行为(Behavior). 对应的标准也分三方面:结 ...
- python-web自动化-元素定位
# -*- coding:utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By # ...
- dll 恐怖的代码调整
总结一波这998的不得不提的调整代码的心得. 调整代码的背景:现有wps美化代码分散在各个插件里面,导致每次修改一小部分代码,都要全新编译,并且只能跟版本发,所以决定将wps的美化代码整合成一个插件d ...
- nginx 返回数据不完整
当nginx 代理解析大量数据流时,会把数据先放在自己的缓冲区,然后一并发给客户端 一次请求的数据量很大, 则会有一部分数据会被忽略掉 前端解析数据会有问题 致使页面白屏 nginx 返回数据不完整的 ...
- 一个free异常引发的异常
有同事反馈说自己的线程不工作,查看堆栈发现其打印如下: # # # # # # # # , info= # <signal handler called> # # # # # # # , ...
- Linux网络编程学习(二) ----- 进程控制(第三章)
1.进程和程序 程序是一个可执行文件,而一个进程是一个执行中的程序实例.一个进程对应于一个程序的执行,进程是动态的,程序是静态的,多个进程可以并发执行同一个程序.比如几个用户可以同时运行一个编辑程序, ...
- python学习Day4 流程控制(if分支,while循环,for循环)
复习 1.变量名命名规范 -- 1.只能由数字.字母 及 _ 组成 -- 2.不能以数字开头 -- 3.不能与系统关键字重名 -- 4._开头有特殊含义 -- 5.__开头__结尾的变量,魔法变量 - ...
- [Ting's笔记Day1] Ruby on Rails练习- MacOS安装篇
千里之行,始于足下.喊了要学Ruby on Rails好久,今天终于要来迈向第一步:安装了! 一开始学习新的事物,主要就是跟着这个网页所说的步骤step by step. 很喜欢这个网页的设计流程,透 ...
- Linux 下监控用户最大进程数参数(nproc)是否到达上限的步骤:
https://www.cnblogs.com/autopenguin/p/6184886.html 1.查看各系统用户的进程(LWP)数: 注意:默认情况下采用 ps 命令并不能显示出所有的进程.因 ...
- 机器学习性能指标(ROC、AUC、召回率)
混淆矩阵 构造一个高正确率或高召回率的分类器比较容易,但很难保证二者同时成立 ROC 横轴:FPR(假正样本率)=FP/(FP+TN) 即,所有负样本中被分错的比例 纵轴:TPR(真正样本率)=TP/ ...