Linux study 1 ---------- create a local yum source in Linux, ---------- linuxyum

Source: Internet
Author: User
Tags gpg yum repolist

Linux study 1 ---------- create a local yum source in Linux, ---------- linuxyum

I just started learning and used it as a note to record what I learned

I. mount a file

Put the iso file in the virtual machine. You can choose to share the file or upload it through a tool connected to Linux.

My uploads on/root/CentOS-6.6-x86_64-bin-DVD1.iso

Create a mount location: mkdir/root/iso

Mount the image file: mount-o loop/root/CentOS-6.6-x86_64-bin-DVD1.iso/root/iso/

2. Modify the yum configuration file to install createrepo

Back up the yum file:

Cd/etc/yum. repos. d/

Rename the file ending with repo: rename. repo. repo. bak *

Copy a file to configure the yum Source: cp CentOS-Base.repo.bak CentOS-Local.repo

Modify the configuration CentOS-Local.repo file: The vim CentOS-Local.repo content is as follows

Name = CentOS-Local
Baseurl = file: // root/iso
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Clear yum Source: yum clean all

View yum Source: yum repolist all

Install httpd and createrepo using yum:

Yum install-y httpd

Yum install-y createrepo

3. Copy the Packas package to the Apache path

Switch path: cd/var/www/html

Create a file: mkdir centos6.6

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

4. Start the Apache server service

View httpd status: services httpd status

Modify the CentOS-Local.repo configuration file: baseurl = file: // root/iso to http: //

Disable firewall: service iptables stop

Start httpd service: service httpd start

Whether the Website access httpd starts properly: http: //

Switch to the Packages Directory: cd/var/www/html/centos6.6/Packages/
# Start to create repodata data: createrepo. (Note: There is a "." After createrepo ".")

Clear yum Source: yum clean all

View yum Source: yum repolist all

If the yum source has an available package, the production is complete.

To use the yum installation package on other machines, you only need to modify/etc/yum. repos. d/The baseurl path of the CentOS-Local.repo file points to this line, so that each machine does not have to access the network

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: 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.