CentOS6.5 how to use a CD as a local yum source

Source: Internet
Author: User
Create a file directory cyclically (this command is for you. you may know that one-time nested directory creation is useful, but it is recommended) mkdir/a/{,, b, c, d, cdrom}-p: Mount the ISO file or partition of the optical drive (the ISO file has been copied to the c6564 folder). select a Mount mode as needed [root @ localhost

Create a file directory cyclically (this command is sent to everyone. it may be useful for anyone who knows how to create one-time nested directories. it is particularly recommended)

Mkdir/a/{1, 2, 4, a, B, c, d, cdrom}-p


Mount the ISO file or partition of the optical drive (the ISO file has been copied to the c6564 folder)

Select a Mount mode as needed

[Root @ localhost ~] # Mount/dev/cdrom/a/cdrom/
[Root @ localhost ~] # Mount/dev/sdb1/a/cdrom/

Modify the default source. back up the file before modification.

[Root @ localhost ~] # Cp/etc/yum. repos. d/CentOS-Base.repo/etc/yum. repos. d/CentOS-Base.repo.bak
Or
[Root @ localhost ~] # Cat/etc/yum. repos. d/CentOS-Base.repo>/etc/yum. repos. d/CentOS-Base.repo.bak

Edit yum file
Enabled = 1 1 Start 0 do not start
Gpgcheck = 1 1 Detection 0 Not detected

[Root @ localhost ~] # Vi/etc/yum. repos. d/CentOS-Base.repo
[Base]
Name = Base
Baseurl = file: // a/cdrom/c6564
Gpgcheck = 1
Enabled = 1
Gpgkey = file: // a/cdrom/c6564/RPM-GPG-KEY-CentOS-6

Clear Cache and create new cache
[Root @ localhost ~] # Yum clean all (clear cache)
[Root @ localhost ~] # Yum makecache (new cache)

2014.02.01 <六>

23:

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.