1. 创建同步文件

参考清华的Centos源,配置同步文件。https://mirrors.tuna.tsinghua.edu.cn/help/centos/

[root@localhost centos]# cat centos-repo.conf
[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=
enabled=
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

2. 同步源到本地文件夹(此文件夹需要结合nginx 配置成网络可访问的文件服务器:nginx location 配置详解

[root@localhost centos]# reposync -c centos-repo.conf 

3. 创建 repo 

cd $i && createrepo .

4. 定时同步

crontab -e
* * * /usr/bin/reposync -np /home/centos

5. 重新配置镜像地址

本方法的一个例子,可以参考lustre文件系统安装

参考链接:

https://www.cnblogs.com/juandx/p/6136621.html

https://blog.csdn.net/u012402276/article/details/53158682

https://blog.csdn.net/moyuanbomo/article/details/81667006

可参考:可选配置文件

/usr/bin/reposync -np /home/centos -c centos-repo.conf

centos 下创建本地镜像源,结合 nginx的更多相关文章

  1. [转载]CentOS 7 创建本地YUM源

    本文中的"本地YUM源"包括三种类型:一是直接使用CentOS光盘作为本地yum源,优点是简单便捷,缺点是光盘软件包可能不完整(centos 7 Everything 总共才6.5 ...

  2. CentOS下建立本地YUM源并自动更新

    1. 尽管有很多的免费镜像提供yum源服务,但是还是有必要建立自己的yum服务器,主要出于以下几点考虑: l 网络速度:访问互联网可能比较慢 l 节省带宽:如果有大量的服务器,架设自己的yum源可以有 ...

  3. 【创建本地仓库】【for Centos】CentOS下创建本地repository

    [日期]2014年4月24日 [平台]Centos 6.5 [工具]httpd yum-utils createrepo [步骤] 1)安装httpd. yum install httpd 2)安装y ...

  4. CentOS7创建本地YUM源的三种方法

    这篇文章主要介绍了CentOS7创建本地YUM源的三种方法,本文讲解了使用CentOS光盘作为本地yum源.如何为CentOS创建公共镜像.创建完全自定义的本地源等内容,需要的朋友可以参考下     ...

  5. 为CentOS 6 配置本地YUM源

    在网上找了很多为CentOS 6配置本地YUM源的方法,其中有很多是与网络相关的,我只想配个自己用的,结果就发现这个方法比较简单实用,就转过来了. 环境:CentOS 6.0 默认的yum是以网络来安 ...

  6. linux 下载rpm包到本地,createrepo:创建本地YUM源

    如何下载rpm包到本地 设置yum安装时,保留rpm包. 1.编辑 /etc/yum.conf 将keepcache的值设置为1; 这样就可以将yum安装时的rpm包保存在 /var/cache/yu ...

  7. 创建本地RPM源之更新系统旧版软件mysql

    事情起因 系统版本为Centos6.6 ,因为之前同事没有采用最小化选择性安装,所以系统安装好后自带有mysql5.1的三个安装包: [root@test ~]# rpm -qa | grep mys ...

  8. CentOS 6.x 本地yum源配置与使用

    系统默认已经安装了可使用yum的软件包,所以可以直接配置: # mount  /dev/cdrom  /mnt                                挂载镜像,可以写到配置文件 ...

  9. 一、在windows环境下修改pip镜像源的方法(以python3为例)

    在windows环境下修改pip镜像源的方法(以python3为例) 1.在windows文件管理器中,输入 %APPDATA% 2.会定位到一个新的目录下,在该目录下新建pip文件夹,然后到pip文 ...

随机推荐

  1. python升级带来的yum异常(解决错误File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:)

    解决错误File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: 错误: 原因: 这是因为yum采用python作为命令解 ...

  2. Win2003下IIS以FastCGI模式运行PHP

    由于PHP5.3 的改进,原有的IIS 通过isapi 方式解析PHP脚本已经不被支持,PHP从5.3.0 以后的版本开始使用微软的 fastcgi 模式,这是一个更先进的方式,运行速度更快,更稳定. ...

  3. linux的路由功能实现

    参考URL: https://blog.csdn.net/chengqiuming/article/details/80140768 一,启用Linux的路由转发功能. 二,新建veth pair 三 ...

  4. 断点调试debugger

    断点调试有两种打点方式 (1)控制台手动打点 (2)代码中添加 debugger打点 .

  5. vue中简单的数据请求 fetch axios

    fetch 不需要额外的安装什么东西,直接就可以使用 fetch(url, { method:'post', headers: { 'Content-Type': 'application/x-www ...

  6. Goldbach`s Conjecture(LightOJ - 1259)【简单数论】【筛法】

    Goldbach`s Conjecture(LightOJ - 1259)[简单数论][筛法] 标签: 入门讲座题解 数论 题目描述 Goldbach's conjecture is one of t ...

  7. The Three Rules/Laws of TDD

    You are not allowed to write any production code unless it is to make a failing unit test pass. 除非为了 ...

  8. Linux 编译工具 gcc/g++、Make/Makefile、CMake/CMakeLists.txt、qmake

    前言 编译器的主要工作流程: 源码(Source Code)>> 预处理器(Preprocessor)>> 编译器(Compiler)>> 汇编程序(Assembl ...

  9. python实现圣诞树

    先来个迷你的 *_* height = 5 stars = 1 for i in range(height): print((' ' * (height - i)) + ('*' * stars)) ...

  10. python接口自动化9-ddt数据驱动

    前言 ddt:数据驱动,说的简单一点,就是多组测试数据,比如点点点的时候登录输入正常.异常的数据进行登录. 实际项目中,自动化测试用得很少,但也有人用excel来维护测试数据 一.ddt 1.安装:p ...