Building a yum Warehouse

Source: Internet
Author: User
Tags yum repolist



Yum Warehouse can support 3 ways for yum to download RPM packages during installation


FTP Service ftp://


HTTP Service


Local file file://




To build a Yum repository first, create a file that ends with. Repo under/etc/yum.repos.d/, in the following format:

[ ]                           # [ ]  write the repository ID, must be unique name=                          # name is the name of Yum and must be unique basesurl=                     #  Specify the path you access to those RPM packages gpgcheck=                     #  1 means check the public key, when checking the public key to specify the Gpgkey address, 0 means no check enable=                       # 1 means enable this warehouse, 0 means no gpgkey=   enabled                      #  when GPGCheck=1  need to be added when gpgkey=0  is not required 




Setting up an extranet yum source

[Email protected] ~]# vim/etc/yum.repos.d/163.repo[contrib]name=centos-$releasever-contrib-163.combaseurl=http:/ /mirrors.163.com/centos/6/contrib/$basearch/gpgcheck=1enabled=1gpgkey=http://mirror.centos.org/centos/ Rpm-gpg-key-centos-6



Build local yum repositories with CDs

Mount the disc to/mnt/cdrom and then create the. repo file under/etc/yum.repos.d/

[[email protected] ~]# Mount/dev/sr0/mnt/cdrom[[email protected] ~]# cat >>/etc/yum.repos.d/iso.repo <<end > [iso]> name=rhel-7.1 server.x86_64> baseurl=file:///mnt/cdrom> gpgcheck=0> enable=1> END




Build yourself a local yum warehouse

Need to install Createrepo first, Createrepo will generate a repodata of the Software Information warehouse (in the ISO also has repodata, no this file will not be able to build a yum warehouse)

First put the downloaded RPM package in a directory such as/rpm_home

Re-use Createrepo software

[Email protected] ~]# Createrepo/rpm_home

A repodata file is generated under the/rpm_home directory


You can then create the corresponding. repo file under/etc/yum.repos.d/.

[email protected] ~]# cat >>/etc/yum.repos.d/rpm_home.repo <<END> [rpm_home]> name=centos-rpm_home > baseurl=file:///rpm_home> gpgcheck=0> enable=1> end[[email protected] ~]# Yum install Rpm_home



Yum Repolist [All | enable | disable] View the number of Yum warehouses default display enabled warehouses




This article is from the "11417860" blog, please be sure to keep this source http://11427860.blog.51cto.com/11417860/1769560

Building a yum Warehouse

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.