Linux learning a----------Linux making local Yum source

Source: Internet
Author: User
Tags yum repolist

Just started to learn, as a note to record what you learn

I. Mounting documents

Put the ISO file in the virtual machine, you can choose to share the file or upload it through a Linux-connected tool.

My uploads are in/root/centos-6.6-x86_64-bin-dvd1.iso.

Create Mount Location: Mkdir/root/iso

Mount image file: Mount-o loop/root/centos-6.6-x86_64-bin-dvd1.iso/root/iso/

Second, modify the Yum configuration file to install Createrepo

To back up the Yum file:

cd/etc/yum.repos.d/

Rename repo end of file: Rename. Repo. Repo.bak *

Copy a file to configure the Yum Source: CP Centos-base.repo.bak Centos-local.repo

Modify configuration Centos-local.repo file: Vim Centos-local.repo content as follows

[CENTO6.6-DVD1]
Name=centos-local
Baseurl=file:///root/iso
Enabled=1
Gpgcheck=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-6

Empty yum Source: Yum Clean all

View Yum Source: Yum Repolist All

Install httpd and Createrepo separately using the Yum installation software:

Yum Install-y httpd

Yum Install-y Createrepo

Third, copy the Packas package to Apache Path

Toggle Path: cd/var/www/html

Create file: mkdir centos6.6

Copy packages:cp-r/root/iso/packages//var/www/html/centos6.6/

Iv. starting the Apache Server service

Viewing httpd Status: Services httpd status

Modify the Centos-local.repo configuration file: Baseurl=file:///root/iso change to Http://192.168.146.233/centos6.6/Packages/

Shut down firewall: Service iptables stop

Start httpd Services: Service httpd start

Web Access httpd startup is normal: http://192.168.146.233/centos6.6/Packages/

Switch to Packages directory: cd/var/www/html/centos6.6/packages/
#开始制作repodata数据: Createrepo. (Note: There is a "." In the back of the Createrepo)

Empty yum Source: Yum Clean all

View Yum Source: Yum Repolist All

Yum source has available packages then make it complete

Other machines to use this yum installation package, just modify the BaseURL path of the Centos-local.repo file in/etc/yum.repos.d/to point here, so you don't have to access the network on every machine.

Linux learning a----------Linux making local Yum source

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.