Configure the YUM repository in RHEL5.X

Source: Internet
Author: User
We know that the yum package has been installed in RHEL5.X by default. We only need to modify the yum configuration file. In fact, the simplest YUM client configuration method is to use our RHEL system to install the CD. First, mount the system disk to the/mnt directory # mount/dev/cdrom/mnt to modify the Yum configuration file. The Yum configuration file is in/etc/yum. repos. d # cd/etc/yum. repos. d. Copy the existing r

We know that the yum package has been installed in the RHEL 5.x system by default. We only need to modify the yum configuration file. In fact, the simplest YUM client configuration method is to use our RHEL system to install the CD.

First, mount the system disk to the/mnt directory.
# Mount/dev/cdrom/mnt
Modify the configuration file of Yum
The Yum configuration file is in the/etc/yum. repos. d directory.
# Cd/etc/yum. repos. d
Copy the existing rehl-debuginfo.repo example file and rename it my. repo
# Cp-p rehl-debuginfo.repo my. repo
Modify my. repo File
# Vim/etc/yum. repos. d/my. repo
In this file, note that the names of all yum sources cannot be repeated.

Configuration File Content Overview:

The repository name is in [].
Name is the repository description or name.

Location of the baseurl Repository

Enabled: whether to enable this repository. 1 indicates the repository is enabled, and 0 indicates the repository is disabled.

Gpgcheck whether to check the GPG signature (used to verify whether the package to be installed is officially RedHat)

We need to use the following command to import the GPGKEY storage address.

Such a simple yum repository has been configured
Use the following command to test whether the configuration is successful.
# Yum list all

Next we will configure the yum repository Server
(1) Mount CD-ROM and install VSFTPd
# Rpm-ivh vsftpd-2.0.5-10.e15.i386.rpm
(2) After installation, copy all the files on the CD to the/var/ftp/pub directory.
# Cp-rvp ../*/var/ftp/pub
(3) switch to the/var/ftp/pub directory
Delete *. html
Delete Server/repodata/TRANS. TBL
Delete VT/repodata/TRANS. TBL
If you do not delete these files, problems may occur.
# Rm-f *. html
# Rm-f Server/repodata/TRANS. TBL
# Rm-f VT/repodata/TRANS. TBL
(4) install the Createrepo tool and use this tool to generate the YUM universal database.
# Rpm-ivh createrepo-0.4.4-2.fc6.noarch.rpm
# Createrepo-g/var/ftp/pub/Server/repodata/comps-rhel5-server-core.xml/var/ftp/pub/Server/
# Createrepo-g/var/ftp/pub/VT/repodata/comps-rhel5-vt.xml/var/ftp/pub/VT/

(5) Then restart the FTP service: service vsftpd restart
The basic success

Delete a program
# Yum remove | erase package1 delete a package

Yum stores the downloaded software package and header in the cache, but does not automatically delete it. If we think they occupy disk space, we can clear them using the yum clean command.
# Yum clean headers clear header
# Yum clean packages clear the downloaded rpm package
# Yum clean all clear header and rpm package

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.