Linux operations, architecture-rpm customization, local yum warehouse setup

Source: Internet
Author: User
Tags fpm

One, customized RPM package

1. Environment

 [[email protected] ~]# cat/etc/redhat-release CentOS release  6.9   (Final) [[email protected]  ~]# uname-< Span style= "COLOR: #000000" >r  2.6 . 32 -696   ~]#/etc/init.d/iptables statusiptables: Firewall  is   not running.[ [Email protected]  ~]# getenforce disabled[[email protected]  ~]# hostname-i  172.19 . 5.61  172.16 . 1.61  

2. Installing FPM

Yum install ruby RubyGems ruby-devel-y #安装ruby模块Gem Sources-a http://mirrors.aliyun.com/rubygems/#添加国内源Gem Sources--remove http://rubygems.org/#移除原生的Ruby仓库gem install fpm #安装fpmgem install fpm-V1.4.0 Error:Building native extensions. This could take a while...  Building native extensions. This could take a while... Error:error Installing FPM: Solution: installing an older version of Fpmgem install FPM-V1.4.0

3. FPM Command Parameter Introduction

FPM--help-s Specifies the source type-T to specify the destination type, both want to make into what package-n Specifies the package's name-v Specifies the package's version number-c specifies the packaged relative path-d specifies which packages are dependent on which package-F is present in the directory if there is an installation package with the same name, overwriting it with the-p output Do not want to be placed in the current directory you need to specify

Two, fpm actual packaging NMP

1, actual combat package Nginx

1.10. 3 ' Pcre-devel,openssl-devel ' --post-install/server/scripts/nginx_rpm.sh/application/nginx-1.10. 3

2, actual combat package PHP

5.5.  + ' zlib libjpeg freetype libpng gd Curl zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl- Devel libjpeg-turbo-devel libcurl-devel libxslt-devel libmcrypt-devel mhash mcrypt' --post-install/ Server/scripts/php_rpm.sh-f/application/php-5.5. /

3, actual combat package MySQL

5.6.  $ ' ncurses-devel libaio-devel CMake ' --post-install/server/scripts/mysql_rpm.sh/application/mysql-5.6. approx ./etc/init.d/mysqld/etc/my.cnf/etc/profile

4. Script files

 #nginx_rpm. sh#useradd-s/sbin/nologin-M Wwwln-s/application/nginx-1.10.3//application/Nginxln-s/application/nginx/sbin/nginx/usr/local/sbin/ #php_rpm. sh##!/bin/SHLN-s/application/php-5.5. +//application/php#mysql_rpm. sh##!/bin/Shuseradd-s/sbin/nologin-M Mysqlln-s/application/mysql-5.6. $//application/Mysqlchown-R mysql.mysql/application/mysql-5.6. $/

5. Other machine test

Yum Localinstall nginx-1.6. 2-1. x86_64.rpm-y

Third, the Yum Warehouse building

1, installation Createrepo

#创建yum源软件

2. Create a Yum repository directory and initialize the Repodata index file

Mkdir-p/APPLICATION/YUM/CENTOS6. 9/x86_64//application/yum/centos6. 9 #拷贝rpm包到此目录  -PDO/APPLICATION/YUM/CENTOS6. 9/x86_64//application/yum/centos6. 9/x86_64/

3. Provision of Yum Services

 &>/dev/null#python的http模块

4. If a new RPM package is placed, it must be updated

Createrepo--UPDATE/APPLICATION/YUM/CENTOS6. 9/x86_64/

5, the client modifies the Yum source

cd/etc/yum.repos.d/vi local.repo[onlylady]name=serverbaseurl=http://172.19.5.61 enable=1gpgcheck=0yum clean all  #清除本地缓存 --enablerepo= Local--disablerepo=base#显示本地yum源列表 #安装nginx为例 #--enablerepo=local-- disablerepo=base, Extras,updates,epel install Nginx-y

6. Yum Command parameters

Linux operations, architecture-rpm customization, local yum warehouse setup

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.