linux yum source synchronous online

First, the cause

A few days recently discovered server to install new software download packages always online, both cost flow and time-consuming, yum online source for all synchronization down

Second, synchronization source yum

  1. Installation package
    yum -y install yum-utils createrepo
  2. View all warehouses
    yum repolist

    linux yum source synchronous online

  3. Select a warehouse synchronization
    #参数-r为仓库id,参数-p为指定路径下载,会在指定路径下生成跟仓库id一样的文件夹
    reposync -r CentOS7 -p /root/
  4. Generates metadata repository, yum source configuration change
    createrepo /root/CentOS7/
    vim /etc/yum.repos.d/local.repo
    #########################
    [CentOS7]
    name=Centos7.6
    baseurl=file:///root/CentOS7
    gpgcheck=0
    enabled=1
    #########################

Guess you like

Origin blog.51cto.com/jinkcloud/2414249