CentOS Create local Yum repository

Source: Internet
Author: User

How to publish your own software installation and update Yum source

Before we create it, let's take a look at some of the relevant things:

The Yum warehouse can support three ways for yum to download RPM packages when installing

The first type: FTP Service ftp://

The second type: HTTP service

The third type: local file file://

For the moment, we can divide the installation of Yum into the client and server side, and of course your client and server can be a single host


1. First, assume that we apply the name HelloWorld (can refer to the simple RPM package made to create two versions of HelloWorld installation RPM package, helloworld-1.0.0-1.el6.x86_64. RPM and helloworld-1.0.0-2.el6.x86_64.rpm, where the second RPM package is the first upgrade package)

2. Create a Yum repository

    1. sudo mkdir-p/var/www/html/yum_repo/my/packages
    2. sudo cp helloworld-1.0.0-1.el6.x86_64.rpm/var/www/html/yum_repo/my/packages/;
    3. Cd/var/www/html/yum_repo/my/packages; sudo createrepo.
    4. SUDO/ETC/INIT.D/HTTPD start

3. Create a new file on the test machine/etc/yum.repos.d/my.repo, which reads as follows

    1. [My]
    2. Name=my
    3. Baseurl=http://<repos_host>/yum_repos/my/packages
    4. Enabled=1
    5. Gpgcheck=0
    6. Priority=1

Where <repos_host> is the machine name or IP address of the YUM source.


4. Updating the local YUM cache

    1. sudo yum clean all
    2. sudo yum Makecache


5. Query HelloWorld Application

    1. sudo yum list HelloWorld
    2. sudo yum search HelloWorld


6. Install the App

    1. sudo yum install HelloWorld


Then run HelloWorld to test

7. Update your App

7.1 First update the RPM package in the YUM repository, copy the helloworld-1.0.0-2.el6.x86_64.rpm to the/var/www/html/yum_repo/my/packages directory, and then delete the old version of the RPM package. Finally, run the following command to update the warehouse

    1. Cd/var/www/html/yum_repo/my/packages
    2. sudo createrepo.

7.2 Update HelloWorld on client

      1. sudo yum clean all
      2. sudo yum Makecache
      3. sudo yum update HelloWorld

CentOS Create local Yum repository

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.