Build a local yum source server using CentOS

Source: Internet
Author: User
Tags yum repolist

Build a local yum source server using CentOS

Build a local yum source server using CentOS

Install CentOS and configure the network environment of the system
• Configure static IP addresses

Vi/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE = eth0
TYPE = Ethernet
ONBOOT = yes
NM_CONTROLLED = yes
BOOTPROTO = static
IPADDR = 192.168.126.5
NETMASK = 255.255.255.0
GATWAY = 192.168.126.2

• Configure DNS

Vi/etc/resolv. conf

Nameserver 192.168.126.2

If it is a virtual machine, the gateway address is configured.

• Configure the Gateway

Vi/etc/sysconfig/network

NETWORKING = yes
HOSTNAME = yum
GATEWAY = 192.168.126.2

• Restart the network service

Service network restart

Install nginx
• Download nginx

Yum install nginx

If the download fails or the source is not found, you can update the third-party source for installation.
• Set to enable startup

Chkconfig nginx on
• Update nginx Configuration

Vi/etc/nginx. conf

Add the following content to http:

Autoindex on; # enable nginx directory browsing
Autoindex_exact_size off; # the file size is displayed starting from KB.
Autoindex_localtime on; # display the file modification time as the local server time
• Access nginx

Http: // 192.168.126.5

Prepare yun source data
• Get the content of the CD

Mount/dev/cdrom/mnt/
• Copy the CD file to the nginx directory

Mkdir/usr/share/nginx/html/yum

Cp-rf/mnt/*/usr/share/nginx/html/yum/
• Access nginx

Http: // 192.168.126.5/yum

Update yum source information
• Create a yum source configuration file on the client host

Vi/etc/yum. repos. d/LocalServer. repo

[Local]
Name = CentOS/localserver
Baseurl = http: // 192.168.126.5/yum/
Enabled = 1
Gpgkey = http: // 192.168.126.5/yum/RPM-GPG-KEY-CentOS-6
Gpgcheck = 1
• Set other sources to invalid

Vi CentOS-Base.repo

Add enabled = 0
• Check for updates

Yum check-update

Yum repolist

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.