不经常大家不得不在有个别机器上网获得RPM安装包,怎样将RPM包在不能够上网的内网机器安装,就须要能将安装包下载到本地而不设置,然后再把那些包复制到内网机器,举办设置。其它多少个主意是树立镜像服务器,未有测试!上面开首试验,以安装saltstack(salt-master和salt-minion)为例。

正文适用于rhel5.4, 6.4, 7. 仅以el5.4为例。

1)
首先在能上海外国语学院网的机器上设置好yum源。小编的奥迪Q5HEL6.4已经安装了多少个yum源,如下:

1 在线安装方式极为简约:

[rhel6_4-default]
name    = “Red Hat
Enterprise Linux Server release 6.4 (Santiago)”
baseurl  = ftp://192.168.122.100/pub/rhel64
enabled  = 1
gpgcheck = 1
gpgkey  =
ftp://192.168.122.100/pub/rhel64/RPM-GPG-KEY-RedHat-release

# wget –no-check-certificate -O install_salt.sh

# sh install_salt.sh -I

[cloudera-cdh5]
# Packages for Cloudera’s Distribution for
Hadoop, Version 5, on
RedHat or CentOS 6
x86_64
name    = Cloudera’s Distribution for Hadoop, Version 5
enabled  = 1
gpgcheck = 1
baseurl  = ftp://192.168.122.100/pub/cloudera/cdh/5/
gpgkey  = ftp://192.168.122.100/pub/cloudera/cdh/RPM-GPG-KEY-cloudera

以上适用于el5, el6,
el7等版本。能够在/etc/yum.repos.d/上边开采一群repo,保存好上边多少个:

[cloudera-gplextras5]
# Packages for Cloudera’s GPLExtras, Version 5, on RedHat or CentOS 6
x86_64
name    = Cloudera’s GPLExtras, Version 5
enabled  = 1
gpgcheck = 1
baseurl  = ftp://192.168.122.100/pub/cloudera/gplextras/5/
gpgkey  =
ftp://192.168.122.100/pub/cloudera/gplextras/RPM-GPG-KEY-cloudera

epel.repo
epel-testing.repo
saltstack-salt-el5-epel-5.repo

[epel-6]
name=Extra Packages for Enterprise Linux 6
#

#
baseurl=
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=

2 下边首要表达离线安装形式:
此地关键是服务器不可能上国艺术大学网,所以要运用rpm包安装。离线安装rpm包。

为获得saltstack安装包,须求扩展上面包车型大巴yum源:

首先是安装downloadonly插件:

****安装rpmforge
****那步很要紧,在redhat 6和centos 6的epel源上从未有过python-jinja2.
  # wget –no-check-certificate

  # rpm -Uvh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

# yum install yum-downloadonly
然后将第11中学的repo文件复制到/etc/yum.repos.d/上边:

好了,必要的源希图齐全。初叶安装插件yum-plugin-downloadonly.noarch
0:1.1.30-14.el6:

epel.repo
epel-testing.repo
saltstack-salt-el5-epel-5.repo

# yum install yum-downloadonly

下载安装包:

安装实现之后,那台机械就足以下载不过不设置saltstack的RPM包了。

# yum install -y –downloadonly –downloaddir=/root/salt salt-minion
就在/root/salt上边拿到了全方位的离线安装包。将那个安装包复制到其余rhel5.4的机器,就能够使用rpm安装。

# mkdir /root/Downloads/salt-minion
# mkdir /root/Downloads/salt-master
# mkdir /root/Downloads/salt-ssh
# mkdir /root/Downloads/salt-api
# yum install -y –downloadonly
–downloaddir=/root/Downloads/salt-minion salt-minion
# yum install -y –downloadonly
–downloaddir=/root/Downloads/salt-master salt-master
# yum install -y –downloadonly –downloaddir=/root/Downloads/salt-ssh
salt-ssh        ####
minion上没有要求设置任何salt,直接在master通过ssh.
# yum install -y –downloadonly –downloaddir=/root/Downloads/salt-api
salt-api        #### rest api of salt

# rpm -ivh *.rpm 
# service salt-minion status|restart|stop 

2) 把/root/Downloads/salt-minion上面包车型客车rpm复制到别的机器上,然后安装:

附录1:epel.repo

# scp -r /root/Downloads/salt-minion root@anotherIP:~/
# ssh root@anotherIP
# cd ~/salt-minion
# rpm -ivh *.rpm

[root@el5-test salt]# cat /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 5 – $basearch
mirrorlist=
failovermethod=priority
enabled=1
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

###########################################
#### service salt-minion start
#### service salt-master start
#### service salt-api start

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 5 – $basearch – Debug
mirrorlist=
failovermethod=priority
enabled=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=0

同等的能够安装salt-master.

[epel-source]
name=Extra Packages for Enterprise Linux 5 – $basearch – Source
mirrorlist=
failovermethod=priority
enabled=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=0

RPM包创立入门 
http://www.linuxidc.com/Linux/2015-02/113559.htm

附录2:epel-testing.repo

如何在Linux中创建RPM包? 
http://www.linuxidc.com/Linux/2012-05/60278.htm

[root@el5-test salt]# cat /etc/yum.repos.d/epel-testing.repo
[epel-testing]
name=Extra Packages for Enterprise Linux 5 – Testing – $basearch
#baseurl=
mirrorlist=
failovermethod=priority
enabled=0
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

塑造本人的rpm包
http://www.linuxidc.com/Linux/2013-06/86435.htm

[epel-testing-debuginfo]
name=Extra Packages for Enterprise Linux 5 – Testing – $basearch –
Debug
#baseurl=
mirrorlist=
failovermethod=priority
enabled=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=0

Linux 下rpm安装后的目录结商谈一些布署
http://www.linuxidc.com/Linux/2013-06/85761.htm

[epel-testing-source]
name=Extra Packages for Enterprise Linux 5 – Testing – $basearch –
Source
#baseurl=
mirrorlist=
failovermethod=priority
enabled=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=0

rpm与yum的综合性介绍与示范演示
http://www.linuxidc.com/Linux/2013-05/84480.htm

附录3:saltstack-salt-el5-epel-5.repo

Redhat Linux—rpm 命令详解
http://www.linuxidc.com/Linux/2013-03/81971.htm

[root@el5-test salt]# cat
/etc/yum.repos.d/saltstack-salt-el5-epel-5.repo
[saltstack-salt-el5]
name=Copr repo for salt-el5 owned by saltstack
baseurl=
skip_if_unavailable=True
gpgcheck=1
gpgkey=
enabled=1

利用FPM轻便构建RPM包
http://www.linuxidc.com/linux/2014-06/103019.htm

更多RedHat相关音讯见RedHat 专项论题页面 http://www.linuxidc.com/topicnews.aspx?tid=10

本文永世更新链接地址:http://www.linuxidc.com/Linux/2015-04/116400.htm

本文永恒更新链接地址:http://www.linuxidc.com/Linux/2015-05/117036.htm

图片 1

图片 2

Author

发表评论

电子邮件地址不会被公开。 必填项已用*标注