Create a local yum source in RHEL 5
1 first, copy the Server folder in RHEL to/yum.
[Root @ localhost/] # mkdir/yum
[Root @ localhost/] # mount/dev/cdrom/mnt
[Root @ localhost/] # cp-rv/mnt/Server // yum
2. edit the file in/etc/yum. repo. d/as follows:
[Root @ localhost ~] # Cd/etc/yum. repo. d
[Root @ localhost yum. repo. d] # ls
Copy the rhel-debuginfo.repo file named pcserver. repo:
[Root @ localhost yum. repo. d] # cp rhel * pcserver. repo
Use vim to edit the file:
[Root @ localhost yum. repo. d] # vim pcserver. repo
Change the source file to the following:
[Server]
Name = Server
Baseurl = file: // yum/Server
Enabled = 1
Gpgcheck = 0
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release
1 is enabled, 0 is disabled
Enabled indicates whether to enable Source
Gpgkey is the verification key.
Gpgcheck is used to check the software signature. To check the software signature, set it to 1.
About baseurl
If the yum source is local, use the fille: // local address;
If the yum source is at the remote end, http: // or ftp: // should be used ://.
3. Go to the/yum directory and install createrepo:
[Root @ localhost Server] # rpm-ivh createrepo <tab>
4. Copy the group information of the rpm package under/Server:
[Root @ localhost Server] # cp repodata/comps-rhel5-server-core.xml/root
Note: The comps-rhel5-server-core.xml is the rpm package group information, this information cannot be generated by createrepo, so you need to back up the files in the disc.
5. Use the createrepo command to generate the yum repository dependency:
[Root @ localhost Server] # createrepo-g/root/comps-rhel5-server-core.xml/yum/Server
6. Clear the yum information saved by the current system:
[Root @ localhost yum. repo. d] # yum clean all
7. Refresh the yum source list:
[Root @ localhost yum. repo. d] # yum list all
8. Conduct the test
[Root @ localhost yum. repo. d] # yum install ntp
After performing the above eight steps, the local yum source is basically set up. Hope to help you.
For more YUM tutorials, see the following:
RedHat 6.2 modify yum source in Linux use CentOS source for free
Configure the epel yum Source
Redhat local yum source configuration
Description of yum configuration file
Install yum in RedHat 6.1)
YUM installation and cleaning
Build yum local source on CentOS 6.4