Centos 6.5 Create local Yum repository

Source: Internet
Author: User

Locally built local Yum source with rpm all from centos-6.5-bin-dvd1&dvd2;

I am installing in a virtual machine environment, check my operating system version first:

[[email protected] ~]$ uname-mi686[[email protected] ~]$ cat/etc/centos-release CentOS release 6.5 (Final)


3. Because configuring the local Yum source requires modifying/directory files and/etc configuration files, we recommend that you change to the root user; "Su-"


4. First create a local directory to store the RPM package, I choose to create directly in/below, you can customize:

[[email protected] ~]# mkdir/yumload[[email protected] ~]# cd/yumload/[[email protected] yumload]# pwd/yumload

5. Then copy all of the RPM packages from the packages in the two DVDs to the/yumload:

[Email protected] yumload]# cp/media/centos_6.5_final/packages/*/[[email protected] yumload]# LL./*.rpm | Wc-l #两张DVD一共有的rpm包的数量; 4802

6. Then use the Createrepo instruction to create the local REPO,CENTOS6 default does not install Createrepo, need to install manually, it doesn't matter, in our DVD CD has integrated the Createrepo package, if the newspaper needs to rely on the use of other packages installed, Install it in turn.

[Email protected] yumload]# RPM-IVH createrepo-0.9.9-18.el6.noarch.rpm #安装createrepo [[email protected] yumload]# Crea terepo/yumload/#创建yum仓库, wait patiently, you can add the-v parameter to list execution information spawning worker 0 with 4802 pkgsworkers finishedgathering worker Results Sa Ving Tsun Primary metadatasaving file lists metadatasaving other metadatagenerating sqlite dbssqlite DBs complete3 [[Email Prot Ected] yumload]#

7. Create a repo file under/etc/yum.repo.d/, the file name can be customized, but be sure to end with repo and add something:

[ultraera.org] #仓库名称可以自定义name =this is a local repo #描述信息baseurl =file:///yumload/#这里填写仓库的url, note that there are three A forward slash enabled=1 #是否开启仓库, 1 is on, 0 is off gpgcheck=0 #是否检

8. In addition, if you want to add the package group information, you can put the DVD1 in the Repodata file in the *-comps.xml file, using ceraterepo-g loading the local repository, the code is as follows:

[[email protected] repodata]# Createrepo-g [The characters may be different, the suffix is correct]c6-i386-comps.xml/yumload/

9. Here The local Yum source is already set up, then reinitialize the Yum cache:

[[email protected] repodata]# yum clean allcleaning repos:  ultraera.orgcleaning up everythingcleaning up list of fastest mirrors[[ email protected] repodata]# yum makecacheloaded plugins: fastestmirror,  refresh-packagekit, securitydetermining fastest mirrorsultraera.org                                                                                                                                    | 2.9 kb     00:00 ... ultraera.org /filelists_db                                                                                                                             | 4.9 MB      00:00 ... ultraera.org/primary_db                                                                                                                             |  3.5 mb     00:00 ... ultraera.org/other_db                                                                                                                               | 2.1 mb     00:00 ... metadata cache  created

10. Test whether the group information is added correctly can use the following code, as long as there is output information to indicate success

[email protected] ~]# Yum grouplist


Centos 6.5 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.