There was a problem when installing the test environment, there was no file or directory in the/ETC/YUM/REPOS.D, and the Yum source could not be updated.
Workaround:
(first, configure the network yum source)
1. First create a Yum.repo under the/etc/yum/repos.d/folder (name is also capable, the suffix is. Repo) file.
Vim/etc/yum.repos.d/yum.repo
2. Open the file to add such as the following content (.... No need to join):
[Server]
Name=server ... the name of the Server, the ....
Baseurl= your yum source address ..... file address of the Yum Library
Enable=1 ..... Apply this server
Gpgcheck=0 ........ Turn off validation
An address is recommended here: http://mirrors.ustc.edu.cn/centos/5/updates/$basearch/,
[Server]
Name=server ... the name of the Server, the ....
Baseurl=http://mirrors.ustc.edu.cn/centos/5/updates/$basearch/..... file address of the Yum Library
Enable=1 ..... Apply this server
Gpgcheck=0 ........ Turn off validation
Assuming the file cannot be saved, the assignment permission can be
After saving, enter the Yum list test and find available.
(second, configure local Yum source)1. Create mount point/mnt/cdrom
[Email protected]]# mkdir(Create a new subfolder) /mnt/cdrom
[[Email protected]]# mount/dev/sr0/mnt/cdrom Mount/dev/cdrom to disc
Mount:block device(device) /dev/cdrom is write-protected, mounting read-only (with this hint is successful)
2. Settings
[Server]
Name=server ... the name of the Server, the ....
baseurl=file:///mnt/cdrom/. The file address of the Yum Library
Enable=1 ..... Apply this server
Gpgcheck=0 ........ Turn off validation
Test by
ADD:
A brief description of the contents of the configuration file:
[] Inside the warehouse name, assuming the file already exists, the default is OK. Manual input allows you to enter a random name
Name warehouse descriptive narrative, can be arbitrary
BaseURL is the Yum source address, because FTP is configured here, it can be http,file, etc.
Enabled to enable this repository, 1 for use, 0 for disable
Gpgcheck whether to check the GPG signature (to verify that the package to be installed is Redhat official)
Linux (readhat) Yum source installation