Create a local yum source in RHEL 5

Source: Internet
Author: User

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

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.