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: