Attach a Local CD to centos 7 as the image source

Source: Internet
Author: User

Attach a Local CD to centos 7 as the image source
1. Upload the iso file to/usr/local/srcMake sure that the following operations are performed after the ISO file is uploaded.
2. Create the Mount directory mkdir/media/CentOS7
3. mount the iso file mount-t iso9660-o loop/usr/local/src/CentOS-7-x86_64-Everything-1503-01.iso/media/CentOS7
4. Set the automatic mounting of the CD image at startup
Run vi/etc/fstab
(If fstab is entered incorrectly, the host cannot be started normally and enters the emergency mode emergency state ,)
Add the last line (press I to enter edit mode, Press ESC to exit edit mode, and then enter: wq! Press enter to save and exit)
/Usr/local/src/CentOS-7-x86_64-Everything-1503-01.iso/media/CentOS7 defaults, ro, loop 0 0
5. Configure the source
Run vi/etc/yum. repos. d/CentOS7-Localsource.repo # To open the repo file, which is created if it does not exist
Press a to enter the editing mode
Enter the following content:
CentOS7-Localsource
Name = CentOS7
Baseurl = file: // media/Centos7
Enabled = 1
Gpgcheck = 0 Press ESC to exit edit input: wq press enter to save and then exit 6. generate local yum cache and execute yum makecache

Now the local ground source is set up!

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.