Linux to build a yum repository

Source: Internet
Author: User
Tags create directory yum repolist

1. Installing Nginx

2. Build a shared directory for Nginx

3. Install Createrepo, create a repository

4. Client Testing

1. Installing Nginx

Yum list |grep nginx # to see if an Nginx package is available yum install nginx-y #Yum installation nginx

1.1 If no Nginx package is available, create a Yum source file

Vim/etc/yum.repos.d/nginx.repo    # Create a Nginx.repo file in the/etc/yum.repos.d/directory insert as content

Nginx installation package Yum Source Details: http://nginx.org/en/linux_packages.html

1.2 Re-install with the command yum install nginx-y

Yum Install Nginx-y

Installation success!!!

2. Build a shared directory for Nginx/share

2.1 Create a folder and give all master

Mkdir/share                 # Create/share directory touch/share/test.txt        # Create file Test.txtchown-r Nginx. /share/      # belongs to the main group authorization

2.2 Configuring Nginx Shared directory configuration file

cp/etc/nginx/conf.d/default.conf/etc/nginx/conf.d/sharefile.conf    # A separate configuration file is also vim/etc/ nginx/conf.d/sharefile.conf       # Edit the configuration file as shown

2.3 Start Nginx Service

/etc/init.d/network start      # start netstat-an|grep            # to see if the service started successfully

2.4 Web page Test results

Success!!!

3. Create a Yum repository

3.1 Creating a Yum repository directory, which is the directory where RPM packages are placed

Mkdir-p/share/centos/6/os/x86_64/packages/      # Recursive Create directory chown-r nginx./share/                           # Owner permission Settings

3.2 Yum Installation Createrepo

-Y

3.3 Remove several RPM packages from the disc and put them in the/share/centos/6/os/x86_64/packages/.

Mkdir/mnt/cdrom      # Create directory mount/dev/cdrom/mnt/cdrom/     # Mount find/mnt/ cdrom/packages/|grep telnet |xargs-n 1-i cp {}/share/centos/6/os/x86_64/packages/     # Copy installation package

3.4 Creating a Yum Repository

createrepo/share/centos/6/os/x86_64/packages/    # building a repository chown-r./share/                           # Authorized

Yum repository created successfully!!!

4. Client Testing

4.1 Creating a Yum source file Mylocal.repo

Vim/etc/yum.repos.d/mylocal.repo    # Create Mylocal.repo, configure the contents as shown

4.2 Load Test

Yum Clean all           # empty yum cache Yum makecache           # load available yum meta data yum repolist            #  View the details of the Yum source rpm package

4.3 Installing Telnet

Rpm-qa |  -y

Success!!!

Linux to build a yum repository

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.