Build an intranet YUM source server using CentOS

Source: Internet
Author: User

Build an intranet YUM source server using CentOS

As more and more linux servers are installed on the Intranet, you must upload the installation disk to install software on each server. It is troublesome and time-consuming to configure the local yum service. You can install the yum service on a linux server on the Intranet, and then other servers can directly modify the repo file to use the yum service. The installation procedure is as follows:

Linux system environment 1. RHEL version [root @ localhost40 pub] # cat/etc/issue
Red Hat Enterprise Linux Server release 6.5 (Santiago)
2. kernel version [root @ localhost40 pub] # uname-

Linux localhost40.localdomain 2.6.32-431. el6.x86 _ 64

Build a local YUM1. upload the RHEL installation CD file to the Home directory named RHEL. ISO2. create directory/home/RHEL/# mkdir/home/RHEL/3. mounting the ISO file on the installation disc # mount-o loop/home/RHEL. ISO/home/RHEL/4. enter/etc/yum. repos. d/directory, back up the original repo file, create a new repo file, RHEL. repo # cd/etc/yum. repos. d/
# Mkdir bak/
# Cp * bak/
# Vi RHEL. repo
#############################
[Rhel6]
Name = rhel6
Baseurl = file: // home/RHEL
Enabled = 1
Gpgcheck = 0
#############################
5. Save RHEL. repo and run # yum clean all
# Yum update

# Yum makecache

Install and configure the vsftpd service 1. install the vsftpd service yum install vsftpd *
2. After the installation is complete, copy all the files in the/home/RHEL/directory to the/var/ftp/pub directory # cd/home/RHEL
# Cp-rv */var/ftp/pub
3. Switch to the/var/ftp/pub directory to delete *. html
Delete CentOS/repodata/TRANS. TBL
# Cd/var/ftp/pub
# Rm-rf *. html

# Rm-rf repodata/TRANS. TBL

Install the createrepo tool to generate the YUM universal database 1. install createrepo # yum-y install createrepo
# Createrepo-g/var/ftp/pub/repodata/partition/var/ftp/pub/Note: The partition name may be different from each system here, find the comps-rhel6-Server.xml behind it. Restart vsftp and complete the configuration. #/Etc/init. d/vsftpd restart
Or

# Service vsftpd restart

Client yum configuration 1. enter/etc/yum. repos. d/directory, back up the original repo file, create a new repo file, RHEL. repo # cd/etc/yum. repos. d/
# Mkdir bak/
# Cp * bak/
# Vi RHEL. repo
#############################
[Rhel6]
Name = rhel6
Baseurl = ftp: // 192.9.169.99/pub/
Enabled = 1
Gpgcheck = 0
#############################
2. Note that the above baseurl is the ftp address of the yum server just installed. After the installation is complete, run # yum clean all
# Yum update

# Yum makecache

Common yum commands 1. install yum install package to install the specified installation package1
Yum localinstall package local installation package
2. update and upgrade yum update all updates
Yum update package update the specified package
Yum check-update check updatable programs
3. Search for and display the yum info <package> package information
Yum list displays all installed and installable packages
Yum list <package> displays the installation status of the specified package
Yum search <keyword> search for software packages
4. Delete the program yum remove | erase package1 Delete the 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

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.