制作内网yum源 同步阿里的源
本文参考:http://www.studylinux.net/?p=4515
操作系统centos7(selinux firewalld关闭 )
安装cobbler命令修改为阿里的yum源 163的也可以
wget -O /etc/yum.repos.d/CentOS-Base.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
3.安装cobbler命令
最好都安装上
yum -y install cobbler dhcp httpd xinetd tftp-server
4.启动服务器
[root@localhost ~]# systemctl start httpd [root@localhost ~]# systemctl enable httpd Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service. [root@localhost ~]# systemctl start cobblerd [root@localhost ~]# systemctl enable cobblerd Created symlink from /etc/systemd/system/multi-user.target.wants/cobblerd.service to /usr/lib/systemd/system/cobblerd.service. [root@localhost ~]# 如果出错: [root@localhost ~]# rpm -ql cobbler|grep setting /etc/cobbler/settings 把 setting 文件中的server和server_next 修改为本机的IP,默认是127.0.0.1 然后用cobbler check确定没有问题
5.同步源
mkdir -p /var/www/cobbler/repo_mirror cd /var/www/cobbler/repo_mirror cobbler repo add --name=zabbix --mirror=http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/ --arch=x86_64 --breed=yum cobbler reposynctask started: 2017-06-04_143254_reposync task started (id=Reposync, time=Sun Jun 4 14:32:54 2017) hello, reposync run, reposync, run! creating: /var/www/cobbler/repo_mirror/zabbix/config.repo creating: /var/www/cobbler/repo_mirror/zabbix/.origin/zabbix.repo running: /usr/bin/reposync -l -n -d --config=/var/www/cobbler/repo_mirror/zabbix/.origin/zabbix.repo --repoid=zabbix --download_path=/var/www/cobbler/repo_mirror -a x86_64 3.6 kB 00:00 4.3 kB 00:00 3.4 kB 00:00 3.4 kB 00:00 951 B 00:00 170 kB 00:01 155 kB 00:01 167 kB 00:01 epel/x86_64/updateinfo FAILED base/7/x86_64/primary_db FAILED 808 kB 00:08 4.7 MB 00:46 5.6 MB 01:19 5.6 MB 01:00 20 kB 00:00 230 kB 00:03 335 kB 00:07 714 kB 00:04 621 kB 00:15 622 kB 00:16 11 kB 00:00 240 kB 00:04 606 kB 00:08 1.7 MB 00:20 1.7 MB 00:16 5.1 kB 00:00 4.6 kB 00:00 4.7 kB 00:00 3.5 MB 00:48 received on stderr: running: createrepo -c cache -s sha /var/www/cobbler/repo_mirror/zabbix received on stdout: Spawning worker 0 with 7 pkgs Spawning worker 1 with 7 pkgs Workers Finished Saving Primary metadata Saving file lists metadata Saving other metadata Generating sqlite DBs Sqlite DBs completereceived on stderr: running: chown -R root:apache /var/www/cobbler/repo_mirror/zabbix received on stdout: received on stderr: running: chmod -R 755 /var/www/cobbler/repo_mirror/zabbix received on stdout: received on stderr: *** TASK COMPLETE *** [root@localhost repo_mirror]# 检查校验 [root@localhost repo_mirror]# cd /var/www/cobbler/repo_mirror/zabbix/ [root@localhost zabbix]# ll total 10644 drwxr-xr-x 2 root apache 4096 Jun 4 14:35 cache -rwxr-xr-x 1 root apache 111 Jun 4 14:32 config.repo drwxr-xr-x 2 root apache 4096 Jun 4 14:35 repodata -rwxr-xr-x 1 root apache 343120 Apr 25 03:56 zabbix-agent-3.0.9-1.el7.x86_64.rpm -rwxr-xr-x 1 root apache 235320 Apr 25 03:57 zabbix-get-3.0.9-1.el7.x86_64.rpm -rwxr-xr-x 1 root apache 730860 Apr 25 03:57 zabbix-java-gateway-3.0.9-1.el7.x86_64.rpm -rwxr-xr-x 1 root apache 636756 Apr 25 03:57 zabbix-proxy-mysql-3.0.9-1.el7.x86_64.rpm -rwxr-xr-x 1 root apache 636252 Apr 25 03:57 zabbix-proxy-pgsql-3.0.9-1.el7.x86_64.rpm -rwxr-xr-x 1 root apache 620776 Apr 25 03:57 zabbix-proxy-sqlite3-3.0.9-1.el7.x86_64.rpm -rwxr-xr-x 1 root apache 11416 Feb 15 2016 zabbix-release-3.0-1.el7.noarch.rpm -rwxr-xr-x 1 root apache 246096 Apr 25 03:57 zabbix-sender-3.0.9-1.el7.x86_64.rpm -rwxr-xr-x 1 root apache 1819916 Apr 25 03:57 zabbix-server-mysql-3.0.9-1.el7.x86_64.rpm -rwxr-xr-x 1 root apache 1818888 Apr 25 03:57 zabbix-server-pgsql-3.0.9-1.el7.x86_64.rpm -rwxr-xr-x 1 root apache 3679892 Apr 25 03:57 zabbix-web-3.0.9-1.el7.noarch.rpm -rwxr-xr-x 1 root apache 5224 Apr 25 03:57 zabbix-web-japanese-3.0.9-1.el7.noarch.rpm -rwxr-xr-x 1 root apache 4756 Apr 25 03:57 zabbix-web-mysql-3.0.9-1.el7.noarch.rpm -rwxr-xr-x 1 root apache 4768 Apr 25 03:57 zabbix-web-pgsql-3.0.9-1.el7.noarch.rpm [root@localhost zabbix]#
apache 映射的地址
http://192.168.56.113/cobbler/repo_mirror/zabbix/
[root@bogon ~]# vim /etc/yum.repos.d/zabbix.repo [local-zabbix] #可以自己定义 name=local zabbix baseurl=http://192.168.56.113/cobbler/repo_mirror/zabbix/ enabled=1 gpgcheck=0
下面我就没接着写 参考链接的
[root@aqdl ~]# cobbler repo add --name=epel --mirror=https://mirrors.aliyun.com/epel/7/x86_64/ --arch=x86_64 --breed=yum [root@aqdl ~]# cobbler repo add --name=saltstack --mirror=http://repo.saltstack.com/yum/redhat/latest/x86_64/latest/ --arch=x86_64 --breed=yum [root@aqdl ~]# cobbler repo add --name=openstack-mitaka --mirror=https://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-mitaka/ --arch=x86_64 --breed=yum [root@aqdl ~]# cobbler repo add --name=updates --mirror=https://mirrors.aliyun.com/centos/7/updates/x86_64/ --arch=x86_64 --breed=yum [root@aqdl ~]# cobbler repo add --name=extras --mirror=https://mirrors.aliyun.com/centos/7/extras/x86_64/ --arch=x86_64 --breed=yum [root@aqdl ~]# cobbler repo add --name=os --mirror=https://mirrors.aliyun.com/centos/7/os/x86_64/ --arch=x86_64 --breed=yum [root@aqdl ~]# cobbler reposync #在夜深人静的时候同步效果显著!
同步完毕制作
一个repo文件放在 /etc/yum.repos.d/
下面就可以了
转载于:https://blog.51cto.com/wsxxsl/1932101
制作内网yum源 同步阿里的源相关推荐
- #centos7 创建内网yum源 OpenStack源部署
#centos7 创建内网yum源 #centos7 自动化安装 本地 内网 web源创建.更新 createrepo http OpenStack源部署 Elven原创 http://www.cnb ...
- 搭建内网yum源镜像仓库
文章目录 1. 准备 2. 部署 2.1 先安装cobbler命令 2.2 以zabbix3.0为例 搭建内网yum源镜像仓库 主要解决内网服务器,无法访问外网,但需安装必要包,搭建内部yun源 1. ...
- Centos搭建内网yum源
Centos搭建内网yum源 手动创建repo文件 使用yum-config-manager配置yum源 安装yum-utils 手工指定yum源 将gpgcheck设置为0 Centos搭建内网yu ...
- 这次是在没有外网yum仓库的情况下搭建内网yum仓库和无人值守pxe装机
额 表达能力不行大家之间看看把 有什么问题可以和我说说 我是之间发的脚本可以之间使用 ks.cfg文件在最后 #!/bin/bash #filename: yumandpxe.sh DI=/med ...
- CentOS 搭建内部Yum源同步阿里Yum源
背景: 有这样的需求,测试环境网段不能上网,但是测试环境centos安装软件包每一台都配置本地yum源很麻烦,也缺少第三方yum源,特此在内网搭建一台yum源服务器满足这一需求,同时防火墙层面只允许此 ...
- linux 配置内网yum源
一.yum服务器端配置 1.安装FTP软件 #yum install vsftpd #service vsftpd start #chkconfig --add vsftpd #chkconfig ...
- 银河麒麟服务器操作系统V10搭建内网YUM源服务器
文章目录 系统环境 YUM源拉取服务器(外网)配置 安装createrepo组件 添加repo仓库 拉取repo数据 YUM源服务端(内网)配置 YUM源客户端(内网)配置 系统环境 YUM源拉取服务 ...
- linux 内网yum,Linux下 内网环境 通过ISO yum安装依赖
Linux下 内网环境 通过ISO yum安装依赖 上传系统系统镜像 创建镜像挂载点 mkdir iso 将系统镜像挂载到 /iso 挂载点上 [root@localhost home]# mount ...
- centos 7 内网shell脚本同步北京时间
网络时间地址:[http://www.beijing-time.org/t/time.asp](http://www.beijing-time.org/t/time.asp) 原理: 服务器无外网,使 ...
最新文章
- linux 存储映射lun 给_如何在 Linux 上扫描/检测新的 LUN 和 SCSI 磁盘 | Linux 中国
- 科学家首次在野外直接观察到雀类新物种的快速形成
- Java-J2SE专题复习
- centos 6 上安装l7 filter尝试过滤xunlei
- js更改html元素颜色,HTML - 使用JS根据值更改文本的颜色
- Linux基础知识(一)
- 三菱fx5u编程手册_实用分享 | 三菱FX 5U特点是什么?
- 7-zip来解压大于4G以上打包文件
- centos7.2下编译安装git
- a标签点击事件_DOM事件机制
- spring mvc 配置解析之xml
- .idea文件夹是做什么的_33 个 IDEA 最牛配置,写代码太爽了!
- 【python】dict4ini和xmltodict模块用途
- Matlab伯德图如何修改相频特性的角度?终于解决了!
- Unity3D AI:导航系统-导航网格生成
- 西门子TIA PORTAL (博途/STEP 7 )安装反复要求重新启动 STEP7 Basic的许可无法彻底完成
- C语言 PTA 时间换算
- Linux怎么有两个vmdk文件,「Linux」- 挂载 VMDK 文件
- 【OR】S Lemma
- python安装失败未指定_win7 64 位安装 python,提示: 0x80240017-未指定的错误