centos 下创建本地镜像源,结合 nginx
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的更多相关文章
- [转载]CentOS 7 创建本地YUM源
本文中的"本地YUM源"包括三种类型:一是直接使用CentOS光盘作为本地yum源,优点是简单便捷,缺点是光盘软件包可能不完整(centos 7 Everything 总共才6.5 ...
- CentOS下建立本地YUM源并自动更新
1. 尽管有很多的免费镜像提供yum源服务,但是还是有必要建立自己的yum服务器,主要出于以下几点考虑: l 网络速度:访问互联网可能比较慢 l 节省带宽:如果有大量的服务器,架设自己的yum源可以有 ...
- 【创建本地仓库】【for Centos】CentOS下创建本地repository
[日期]2014年4月24日 [平台]Centos 6.5 [工具]httpd yum-utils createrepo [步骤] 1)安装httpd. yum install httpd 2)安装y ...
- CentOS7创建本地YUM源的三种方法
这篇文章主要介绍了CentOS7创建本地YUM源的三种方法,本文讲解了使用CentOS光盘作为本地yum源.如何为CentOS创建公共镜像.创建完全自定义的本地源等内容,需要的朋友可以参考下 ...
- 为CentOS 6 配置本地YUM源
在网上找了很多为CentOS 6配置本地YUM源的方法,其中有很多是与网络相关的,我只想配个自己用的,结果就发现这个方法比较简单实用,就转过来了. 环境:CentOS 6.0 默认的yum是以网络来安 ...
- linux 下载rpm包到本地,createrepo:创建本地YUM源
如何下载rpm包到本地 设置yum安装时,保留rpm包. 1.编辑 /etc/yum.conf 将keepcache的值设置为1; 这样就可以将yum安装时的rpm包保存在 /var/cache/yu ...
- 创建本地RPM源之更新系统旧版软件mysql
事情起因 系统版本为Centos6.6 ,因为之前同事没有采用最小化选择性安装,所以系统安装好后自带有mysql5.1的三个安装包: [root@test ~]# rpm -qa | grep mys ...
- CentOS 6.x 本地yum源配置与使用
系统默认已经安装了可使用yum的软件包,所以可以直接配置: # mount /dev/cdrom /mnt 挂载镜像,可以写到配置文件 ...
- 一、在windows环境下修改pip镜像源的方法(以python3为例)
在windows环境下修改pip镜像源的方法(以python3为例) 1.在windows文件管理器中,输入 %APPDATA% 2.会定位到一个新的目录下,在该目录下新建pip文件夹,然后到pip文 ...
随机推荐
- [转]VBA Check if an outlook folder exists; if not create it
本文转自:http://www.outlookcode.com/d/code/quarexe.htm To quarantine application file attachments This O ...
- iOS多线程定时器
在使用定时器时,我们经常使用NSTimer,但是由于NSTimer会受RunLoop影响,当RunLoop处理的任务很多时,就会导致NSTimer的精度降低,所以在一些对定时器精度要求很高的情况下,应 ...
- 转载一篇:Django静态文件
静态文件: 项目中的CSS.图片.js都是静态文件.一般会将静态文件放到一 个单独的目录中,以方便管理.在html页面中调用时,也需要指 定静态文件的路径,Django中提供了一种解析的方式配置静态文 ...
- scp 拷贝 针对软连接的问题
scp时经常把软连接变成拷贝了两遍,rsync -l可以避免这个问题 1. ln 软连接的scp 我们在系统中,经常用到软连接:当我们从远程机器scp 数据时,这个软连接不会cp过来:而是: 把软连 ...
- HTML Rendering Error
刚下载的markdown弹窗提示html渲染错误 去官网 http://markdownpad.com/faq.html#livepreview-directx 页面搜索 This view h ...
- Redis安装和基本操作
Redis 简介Redis 是完全开源免费的,遵守BSD协议,是一个高性能的key-value数据库. Redis 是属于非关系型数据库1.数据比模型较简单2.需要灵活性更强的IT系统3.对数据库性能 ...
- private构造器和单例模式
// hiding/Lunch.java // Demonstrates class access specifiers. Make a class // effectively private wi ...
- AcWing 77. 翻转单词顺序
习题地址 https://www.acwing.com/problem/content/description/73/ 题目描述输入一个英文句子,翻转句子中单词的顺序,但单词内字符的顺序不变. 为简单 ...
- [WPF]实现TextBox文本框单击全选
原文:[WPF]实现TextBox文本框单击全选 /// <summary> /// Void:设置获取焦点时全选文本 /// </summary&g ...
- Spring Batch基本概念
Spring batch主要有以下部分组成: JobRepository 用来注册job的容器 JobLauncher 用来启动Job的接口 Job ...