Linux source made RMP and added Yum source

Source: Internet
Author: User
Tags rpmbuild yum repolist

Preparatory work

The main function of Yum (Yellow dog updater,modified) is to facilitate the addition, deletion and updating of RPM packages. It solves the problem of package dependencies and makes it easier to manage a large number of system update issues. It can configure multiple warehouses or resource libraries (repository) at the same time, which is where the updated and dependent packages are stored.
Lab Environment:
[Email protected] ~]# cat/etc/redhat-release
Red Hat Enterprise Linux Server Release 7.2 (MAIPO)
Host: Cache IP Address: 192.168.4.2
Host: DB1 IP address: 192.168.4.3
Note: Two hosts are Yum source and can handle other dependencies
The following connection is the prepared source package, as well as the RPM package, there is a need to directly download the use.
Link: https://pan.baidu.com/s/1RtKyNrssQDK0UL9mzt4q0w Password: n87r

One, the source made RPM package

On the host cache, the source is made into a RMP package

[[email protected] ~]# yum-y install Rpm-build//tools for RPM package [[email protected] ~]# rpmbuild-ba nginx-1. 8.0.tar.gz//Intentionally let this command error, used to generate 6 files [[email protected] ~]# ls//view/root will generate Rpmbuild directory anaconda- Ks.cfg Downloads nginx-1.8.0.tar.gz rpmbuild[[email protected] ~]# ls/root/rpmbuild///view 6 Auto-generated directory build BuildRoot RPMS SOURCES SPECS srpms[[email protected] ~]# Cp/root/nginx-1.8.0.tar.gz/root/rpmbui ld/sources///Copy the downloaded source package to the SOURCES directory [[email protected] ~]# Ls/root/rpmbuild/sources/ngin X-1.8.0.tar.gz[[email protected] ~]# cd/root/rpmbuild/specs///directory where spec files are stored [[email protected] SPECS]# V                  Im Nginx.spec//create Nginx.spec file, the file will automatically generate some content in the file, the following is deleted part of the content Name:nginx//Can not be arbitrary, for the software name version:1.8.0 cannot be arbitrary, for the software version number RELEASE:1//The first few dozen RPM package Summary:this is nginx rpm//overview, the content can be arbitrary license:gp                       L       Can be arbitrarily modified, copied, published source0:nginx-1.8.0.tar.gz//Can not be arbitrary, must be the same as the source package name%description%prep%setup-q Automatically unzip and cd%build./configure//change% to./make%{?_smp_mflags}%installmake Install DESTDI r=%{buildroot}%files%doc/usr/local/nginx/*//compress this file [[email protected] specs]# yum-y Install GC C Pcre-devel openssl-devel//install Dependency pack [[email protected] specs]# ls/root/rpmbuild/ rpms/x86_64/nginx-1.8.0-1.x86_64.rpm nginx-debuginfo-1.8.0-1.x86_64.rpm[[email protected] x86_64]# SCP nginx-1.8.0-1.x86_64.rpm 192.168.4.3:/root//Copy RPM package to DB1
Second, RPM package added Yum source

Add the RPM package on the host DB1 to the local Yum source and install the test

[[email protected] ~]# mkdir/nginx//create nginx directory for local Yum source, directory name arbitrary [[email protected] ~]# CP ngi nx-1.8.0-1.x86_64.rpm/nginx/Copy the RMP package to the Yum source directory [[email protected] ~]# createrepo/nginx///Create Yum Warehouse, Createre PO directory [[email protected] ~]# ls/nginx///view, multiple auto-generated repodata directories nginx-1.8.0-1.x86_64.rpm repodata[[email  Protected] ~]# Yum-config-manager--add file:///nginx//Add local yum warehouse [[email protected] ~]# yum Clean all//clear [                                          [email protected] ~]# yum repolist//display Yum source information column source identity source name Status 192.168.4.254_rh7dvd_ added From:http://192.168.4.254/rh7dvd/4,620nginx a dded From:file:///nginx 1repolist:4,621[[email protected] ~]# yum-y install nginx/ /with yum install nginx[[email protected] ~]#/usr/local/nginx/sbin/nginx//Start Nginx, the first 80 ports must be released [[email protected] ~]# Ss-anptu |  Grep:80                  View 80 ports being nginx occupied TCP LISTEN 0 *:80 *:* users: ( ("Nginx", pid=8384,fd=6), ("Nginx", pid=8383,fd=6)) [[email protected] ~]# Rpm-qi nginx//view installed Nginx information, and NGINX.S Information consistent within the PEC name:nginxversion:1.8.0release:1architecture:x86_64install date:2018 April 26 Thursday 03:28 19 seconds g Roup:unspecifiedsize:660775license:gplsignature: (none) Source Rpm:nginx-1.8.0-1.src.rpmbuild date:2018 April 26 Thursday 03:15 45 seconds Build Host:cacherelocations: (not relocatable) Summary:this is Nginx rpmdescript Ion:
Encouragement: I hear and I forget, I see and I-remember, I do and I understand!

Linux source made RMP and added Yum source

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.