多版本YUM仓库搭建

服务器:CentOS7
YUM源:阿里云
空间要求:CentOS6+CentOS7 50G,考虑后期更新预留,LVS空间100G
1、在服务器配置CentOS7的yum源和CentOS6的yum源
#Centos7
[base7]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 [updates7]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 [extras7]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 [epel7]
name=CentOS--epel-cmiot.local
baseurl=https://mirrors.aliyun.com/epel/7/x86_64/
gpgcheck=
#Centos6
[base6]
name=CentOS- - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/6/os/x86_64/
http://mirrors.aliyuncs.com/centos/6/os/x86_64/
http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/
gpgcheck=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6 [updates6]
name=CentOS- - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/6/updates/x86_64/
http://mirrors.aliyuncs.com/centos/6/updates/x86_64/
http://mirrors.cloud.aliyuncs.com/centos/6/updates/x86_64/
gpgcheck=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6 [extras6]
name=CentOS- - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/6/extras/x86_64/
http://mirrors.aliyuncs.com/centos/6/extras/x86_64/
http://mirrors.cloud.aliyuncs.com/centos/6/extras/x86_64/
gpgcheck=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6 [epel6]
name=CentOS--epel-cmiot.local
baseurl=https://mirrors.aliyun.com/epel/6/x86_64/
gpgcheck=
2、检查yum的可用性,并查看yum的repoid

3、安装repo同步工具和必要软件包
yum install -y wget make cmake gcc gcc-c++ pcre-devel zlib-devel openssl openssl-devel createrepo yum-utils
4、创建yum软件包目录并向阿里同步,时间较久。
mkdir -p /mirror/Aliyun/CentOS/
reposync -n --repoid=extras6 --repoid=updates6 --repoid=base6 --repoid=epel6 -p /mirror/Aliyun/CentOS/ mkdir -p /mirror/Aliyun/CentOS/
reposync -n --repoid=extras7 --repoid=updates7 --repoid=base7 --repoid=epel7 -p /mirror/Aliyun/CentOS/
5、创建索引
createrepo -po /mirror/Aliyun/CentOS//base6/ /mirror/Aliyun/CentOS//base6/
createrepo -po /mirror/Aliyun/CentOS//epel6/ /mirror/Aliyun/CentOS//epel6/
createrepo -po /mirror/Aliyun/CentOS//extras6/ /mirror/Aliyun/CentOS//extras6/
createrepo -po /mirror/Aliyun/CentOS//updates6/ /mirror/Aliyun/CentOS//updates6/
createrepo -po /mirror/Aliyun/CentOS//base7/ /mirror/Aliyun/CentOS//base7/
createrepo -po /mirror/Aliyun/CentOS//epel7/ /mirror/Aliyun/CentOS//epel7/
createrepo -po /data/website/centos//extras7 /data/website/centos//extras7
createrepo -po /mirror/Aliyun/CentOS//updates7/ /mirror/Aliyun/CentOS//updates7/
6、安装nginx并配置
worker_processes ;
events {
worker_connections ;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout ;
server {
listen ;
server_name localhost;
root /mirror ; #这里是yum源存放目录
location / {
autoindex on; #打开目录浏览功能
autoindex_exact_size off; # off:以可读的方式显示文件大小
autoindex_localtime on; # on、off:是否以服务器的文件时间作为显示的时间
charset utf-,gbk; #展示中文文件名
index index.html;
}
error_page /50x.html;
location = /50x.html {
root html;
}
}
}
7、创建更新软件包的定时任务
0 1 * * * /mirror/update.sh
#!/bin/bash
reposync -n --repoid=extras6 --repoid=updates6 --repoid=base6 --repoid=epel6 -p /mirror/Aliyun/CentOS/
reposync -n --repoid=extras7 --repoid=updates7 --repoid=base7 --repoid=epel7 -p /mirror/Aliyun/CentOS/
createrepo --update /mirror/Aliyun/CentOS//base6/
createrepo --update /mirror/Aliyun/CentOS//epel6/
createrepo --update /mirror/Aliyun/CentOS//extras6/
createrepo --update /mirror/Aliyun/CentOS//updates6/
createrepo --update /mirror/Aliyun/CentOS//base7/
createrepo --update /mirror/Aliyun/CentOS//epel7/
createrepo --update /mirror/Aliyun/CentOS//extras7/
createrepo --update /mirror/Aliyun/CentOS//updates7/
8、配置客户端yum文件使用
[base]
name=CentOS-$releasever - Base
baseurl=http://10.150.203.8/Aliyun/CentOS/$releasever/base$releasever
gpgcheck=
gpgkey=http://10.150.203.8/Aliyun/CentOS/RPM-GPG-KEY-CentOS-$releasever [updates]
name=CentOS-$releasever - Updates
baseurl=http://10.150.203.8/Aliyun/CentOS/$releasever/updates$releasever
gpgcheck=
gpgkey=http://10.150.203.8/Aliyun/CentOS/RPM-GPG-KEY-CentOS-$releasever [extras]
name=CentOS-$releasever - Extras
baseurl=http://10.150.203.8/Aliyun/CentOS/$releasever/extras$releasever
gpgcheck=
gpgkey=http://10.150.203.8/Aliyun/CentOS/RPM-GPG-KEY-CentOS-$releasever [epel]
name=CentOS-$releasever - epel
baseurl=http://10.150.203.8/Aliyun/CentOS/$releasever/epel$releasever
gpgcheck=
多版本YUM仓库搭建的更多相关文章
- 自动化利器-YUM仓库搭建实战
本地YUM仓库搭建实战 YUM主要用于自动安装.升级rpm软件包,它能自动查找并解决rpm包之间的依赖关系.要成功的使用YUM工具安装更新软件或系统,就需要有一个包含各种rpm软件包的reposito ...
- 其他综合-内网下Yum仓库搭建配置
内网下Yum仓库搭建配置 1.实验环境 虚拟机环境: VMware 12 版本虚拟机 网络环境: 内网 IP 段:172.16.1.0 外网 iP 段(模拟):10.0.0.0 实验基础:(能够上网, ...
- 本地YUM仓库搭建实战
YUM主要用于自动安装.升级rpm软件包,它能自动查找并解决rpm包之间的依赖关系.要成功的使用YUM工具安装更新软件或系统,就需要有一个包含各种rpm软件包的repository(软件仓库),这个软 ...
- linux运维、架构之路-rpm定制、本地yum仓库搭建
一.定制rpm包 1.环境 [root@m01 ~]# cat /etc/redhat-release CentOS release 6.9 (Final) [root@m01 ~]# uname - ...
- Firewalld共享上网及本地yum仓库搭建
1.firewalld共享上网 1.服务端操作(有外网的服务器) 1.开启防火墙并加入开机自启动 [root@zeq ~]# systemctl start firewalld [root@zeq ~ ...
- mysql5.7版本yum安装---redhat7.0
1.官网下载yum包 [root@test01 test]# wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch ...
- 本地yum仓库搭建,使用163yum源
如果内部网络没有连接Internet就在本地配置yum仓库 将操作系统镜像上传到服务器中,进行挂载 mount –o loop rhel-server-6.7-x86_64-dvd.iso /mnt ...
- 定制化rpm包及本地yum仓库搭建
为方便本地yum的管理,一般都是在公司局域网内搭建本地yum仓库,实现公司内部快速安装常用软件. 步骤如下: 1.搭建要实现本地yum管理的软件,测试该软件搭建成功与否: 2.定制rpm包及其相关依赖 ...
- redhat6.8服务器版本 yum 源的配置
阿里云的源地址: http://mirrors.aliyun.com/ 打开后点击帮助: 有如下提示: 不过不能直接使用这个源,因为自己使用的是服务器版本,要修改一个变量,先将源文件下载下来. wge ...
随机推荐
- codeblock的一个小问题
也许不叫问题吧,也可能是编译器的特性. 我的codeblock选择的编译器: 编写.cpp文件时,floatl类型输入输出都是 %f,double类型输入只能是 %lf,输出只能是 %f. 但是在co ...
- JavaScript相等运算符
★相等运算符 相等运算符用来比较两个值是否相等 如果相等会返回true,否则返回false ㈠使用 == 来做相等运算 ⑴当使用 == 来比较两个值时,如果值的类型不同, 则会自动进行类型转换 ...
- Luogu P2511 [HAOI2008]木棍分割 二分+DP
思路:二分+DP 提交:3次 错因:二分写萎了,$cnt$记录段数但没有初始化成$1$,$m$切的次数没有$+1$ 思路: 先二分答案,不提: 然后有个很$naive$的$DP$: 设$f[i][j] ...
- PHP mysqli_field_count() 函数
定义和用法 mysqli_field_count() 函数返回最近查询的列数. 假设我们有一个 "websites" 表,其中有 5 个字段 20 行记录.返回最近查询的列数: & ...
- MIME协议(四) -- MIME消息的头字段
MIME消息的头字段 4.1 Content-Type 对于表示某个具体资源的MIME消息,它的消息头中需要指定资源的数据类型:对于MIME组合消息,它的消息头中需要指定组合关系.具体资源的数据类型 ...
- Failed to execute goal maven-gpg-plugin 1.5 Sign
问题描述: 解决办法:跳过maven-gpg-plugin <build> <pluginManagement> <plugins> <plugin> ...
- moveUp()
这个函数内容有点多,想讲一下大概思路: 向上移有两种情况1.前面为空白 这种情况有两个步骤 (1)将人当前的位置设置为空白(0), (2)再讲人前面的位置设置为人(2)2.前面为箱子 当前面为箱子时有 ...
- 在 Go 语言中使用 Session(一)
在上一篇博客 理解Cookie和Session 中,我们了解了 Cookie 和 Session 的一些基础知识,也知道了 Session 的基本原理是由服务端保存一份状态信息(以及它的唯一标识符), ...
- 【Spring Boot】 Spring Boot 2.x 版本 CacheManager 配置方式
Spring Boot 1.X RedisCacheManager 配置方式 @Bean public CacheManager cacheManager(RedisTemplate redisTem ...
- Netfilter 之 连接跟踪的helper
注册helper nf_conntrack_ftp_init是连接跟踪ftp模块的初始化函数,可以看到其调用了nf_conntrack_helpers_register来注册helper: stati ...