linux
  • Introduction
  • Yum
    • 基础yum源的配置
    • 为yum源配置代理
    • Centos指定版本的yum源
    • 环境变量
    • 本地yum源
    • 制作yum源
      • 同步yum源
    • epel源
  • Iptables
    • 基本匹配条件
    • Match-Extensions
      • Addrtype
      • Set
      • TCP
    • Target-Extensions
      • DNAT
      • LOG
    • Iptables规则持久化
    • 连接追踪
  • LVS
    • Ipvsadm命令
  • 磁盘与分区
    • 创建分区
    • 格式化与挂载
    • fstab
    • LVM
      • LVM扩容
    • swap分区
    • tmpfs
  • 网络相关
    • 重命名网卡
    • resolv.conf
    • Tcpdump
    • dig与nslookup
  • Other
    • CPU与内存
    • 进程
      • 僵尸进程
    • SSH密钥登录
    • 用户管理
    • Crontab
  • Nofile
    • 原理
  • 常用软件安装篇
    • MYSQL
    • 系统与内核
      • 指定内核启动
    • NFS
    • Haproxy
    • Keepalived
    • Squid
    • Redsocks
    • Shadowsocks
    • 时钟同步
  • 内存
Powered by GitBook
On this page
  • 目标
  • 步骤
  • 一、在68上安装httpd与createrepo
  • 二、为68配置12的yum源
  • 三、同步12上的rpm包到68
  • 四、在68上制作yum源
  • 五、使用

Was this helpful?

  1. Yum
  2. 制作yum源

同步yum源

目标

我们需要在10.142.233.68上制作yum源,同步10.142.80.12上的centos源

步骤

一、在68上安装httpd与createrepo

见《制作yum源》

设置httpd的根目录为 /var/www/html

二、为68配置12的yum源

在68的/etc/yum.repos.d/中新建tmp.repo文件,内容如下

[12centos]
name=12centos
baseurl=http://10.142.80.12/centos/7.2.1511/x86_64/
gpgcheck=0
enabled=1

更新yum元数据

$ sudo yum makecache

三、同步12上的rpm包到68

在68任意目录下执行

$ sudo reposync --repoid=12centos --download_path=/var/www/html

该步骤完成后,在/var/www/html/目录下会多出一个文件夹 12centos,该文件夹下有一个文件夹Packages,里面包含了所有的rpm包

四、在68上制作yum源

$ sudo createrepo -d /var/www/html/12centos

五、使用

见《安装教程--httpd+createrepo》

Previous制作yum源Nextepel源

Last updated 5 years ago

Was this helpful?