search

Home  >  Q&A  >  body text

linux - 本地yum源镜像中怎么添加缺少源?

天蓬老师天蓬老师2902 days ago896

reply all(1)I'll reply

  • 迷茫

    迷茫2017-04-17 16:12:57

    First of all, you must create a YUM warehouse for machine A. When machine A updates YUM through the external network, it is actually placed on a similar server, but it uses the public network. As for your other servers accessing A to update source C, it is actually the same as A. Accessing the external network is the same, but it is changed to the internal network. The specific process is as follows:
    1. Server A
    uses root privileges

    1

    <code>yum install createrepo</code>

    Create the warehouse directory after installation

    1

    <code>createrepo -v /var/pub/yum/CentOS/</code>

    The above means that the directory of the warehouse is /var/pub/yum/CentOS/. You need to copy the package you want to update to this directory for use by other machines.
    Generate repodata data

    1

    <code>createrepo -g /var/pub/yum/CentOS/repodata/ /var/pub/yum/CentOS/ </code>

    Enter the /var/pub/yum/CentOS/repodata/ directory

    1

    <code>cd /var/pub/yum/CentOS/repodata/</code>

    Create a YUM source configuration file

    1

    <code>vi localyum.repo    创建一个获取YUM源的配置文件</code>

    1

    2

    3

    4

    5

    <code>[localyum]

    name=localyum

    baseurl=ftp://ServerAIP/pub/yum/CentoOS

    enable=1

    gpgcheck=0    这里值为0,意思是不需要认证签名。</code>

    2. Server B
    Download localyum.repo and put it in the directory /etc/yum.repo.d/
    Update and install

    1

    2

    3

    <code>yum -clean all

    yum update

    yum install C</code>

    If you don’t understand something, keep asking me, or Google how to make a local yum source server

    reply
    0
  • Cancelreply