背景

客户服务器为内网机器,centos7系统,且无法与外网连接。需要部署对应的LANMP环境及其它软件

解决思路

1.在阿里云服务器,利用阿里云的yum源仓库,下载对应软件及关联软件。

2.在客户机上面自建yum仓库,然后通过yum安装,解决依赖问题

下载软件

[root@compute1 tmp]# mkdir -pv /tmp/soft
cd /tmp/soft
[root@compute1 soft]# ll /tmp/soft
total 0
[root@compute1 soft]# yum install nginx --downloadonly --downloaddir=/tmp/soft
[root@compute1 soft]# ll /tmp/soft
total 0
-rw-r--r-- 1 root root 0 Jul 13 14:13 fontconfig-2.10.95-10.el7.x86_64.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 fontpackages-filesystem-1.44-8.el7.noarch.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 gd-2.0.35-26.el7.x86_64.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 GeoIP-1.5.0-11.el7.x86_64.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 libXpm-3.5.11-3.el7.x86_64.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 nginx-1.10.2-1.el7.x86_64.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 nginx-all-modules-1.10.2-1.el7.noarch.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 nginx-filesystem-1.10.2-1.el7.noarch.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 nginx-mod-http-geoip-1.10.2-1.el7.x86_64.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 nginx-mod-http-image-filter-1.10.2-1.el7.x86_64.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 nginx-mod-http-perl-1.10.2-1.el7.x86_64.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 nginx-mod-http-xslt-filter-1.10.2-1.el7.x86_64.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 nginx-mod-mail-1.10.2-1.el7.x86_64.rpm
-rw-r--r-- 1 root root 0 Jul 13 14:13 nginx-mod-stream-1.10.2-1.el7.x86_64.rpm

提示不能使用--downloadonly的请先安装yum-utils软件

[root@compute1 soft]# yum -y install yum-utils

利用yum的参数,进行只下载,不安装,同时会下载对应依赖的软件

自建仓库

将上述app复制到客户内网机器,假设目录为/usr/app

[root@iZ25vh2zuf2Z ~]# cd /usr/app
[root@iZ25vh2zuf2Z app]# createrepo .

createrepo命令不存在的,可以yum install createrepo进行安装

这样自行仓库就建立完成,然后/etc/yum.repos.d/添加对应的配置文件

[root@iZ25vh2zuf2Z yum.repos.d]# cat localself.repo
[self]
name=local
baseurl=file:///usr/app
gpgcheck=0 [root@iZ25vh2zuf2Z yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: self
Cleaning up everything
[root@iZ25vh2zuf2Z yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
repo id repo name status
self local 245
repolist: 245

可以看到自行存放的245个app已经出现在仓库列表中

然后可以通过yum安装自行解决对应的依赖关系,而不是手动安装

自行制作yum源仓库的更多相关文章

  1. Linux 使用系统ISO制作yum源

    关于linux安装问题,大多数情况下 系统开发完成之后,需要部署到生产机器上,客户提供的机器预装好了操作系统,但是都是内网环境 与外网都是物理隔绝的,那么 在搭建生产环境时需要安装相关软件时,如果自己 ...

  2. 自制 yum 源仓库

    转自:https://www.cnblogs.com/marility/p/7278374.html 背景 客户服务器为内网机器,centos7系统,且无法与外网连接.需要部署对应的LANMP环境及其 ...

  3. 97、配置yum源仓库服务器

    (服务端(双(外,内)网卡)--客户端(内网)) YUM主要用于自动安装.升级rpm软件包,它能自动查找并解决rpm包之间的依赖关系.要成功的使用YUM工具安装更新软件或系统, 就需要有一个包含各种r ...

  4. yum源仓库的三种搭建方式

    yum源的三种搭建方式 一.  本地yum仓库的搭建 1.1.获取软件包资源 将iso镜像挂载在本地目录中,此次挂载目录为/var/www/html/repo/,此目录本身不存在,需要创建.软件宝资源 ...

  5. Linux 永久挂载镜像文件和制作yum源

    Linux mount命令是经常会使用到的命令,它用于挂载Linux系统外的文件. 1.镜像挂载到系统指定目录下:[root@master cdrom]#  mount -t auto  /mnt/c ...

  6. CentOS7搭建yum源仓库(阿里源)

    文章目录 注意:环境要求 1.配置服务器端yum 1.1.安装yum源工具 1.2.配置nginx 1.2.1.配置nginx页面目录 1.3.替换yum源文件 1.4.建立yum源仓库 2.配置客户 ...

  7. 部署YUM源仓库与NFS共享存储服务

    镜像下载.域名解析.时间同步请点击 阿里巴巴开源镜像站 一.YUM YUM (Yellow dog Updater Modified) ●基于RPM包构建的软件更新机制 ●可以自动解决依赖关系 ●所有 ...

  8. yum管理——搭建iso镜像私有yum源仓库(1)

    在服务器上一般是没有光驱的,那么我们怎么制作iso本地repo镜像源仓库? 通过本地iso镜像,copy到linux系统中一个目录中,进行伪文件系统挂载,执行如下命令: 挂载:mount -o loo ...

  9. linux 搭建局域网YUM源仓库服务器

    yum简介 Yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器.基于RPM包管理,能够从指定的服 ...

随机推荐

  1. php常见的验证方法

    php常见的验证方法 干货文章 ·2018-03-16 23:50:36 <?php /** * @param $id * @return false|int * 检测id */ functio ...

  2. elasticsearch启动常见问题

    原文:https://blog.csdn.net/qq_22211217/article/details/80740873 一.Exception in thread "main" ...

  3. shell 编程四剑客简介 find sed grep awk(微信公众号摘抄)

    一,Shell编程四剑客之Find 通过如上基础语法的学习,读者对Shell编程有了更近一步的理解,Shell编程不再是简单命令的堆积,而是演变成了各种特殊的语句.各种语法.编程工具.各种命令的集合. ...

  4. CodeForces - 337D 树形dp

    题意:一颗树上有且仅有一只恶魔,恶魔会污染距离它小于等于d的点,现在已经知道被污染的m个点,问恶魔在的可能结点的数量. 容易想到,要是一个点到(距离最远的两个点)的距离都小于等于d,那么这个点就有可能 ...

  5. PHP-组合总和

    给定一个无重复元素的数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合. candidates 中的数字可以无限制重复被选 ...

  6. vue 点击切换图标

    <div @click="showImg" class="showSearch"> <img class="header_img&q ...

  7. 解决ubuntu终端路劲显示过长问题

    1 找到配置文件先进行备份:  cp  ~/.bashrc  ~/.bashrc-bak 2 找到配置文件修改: vi  ~/.bashrc 备份是为了防止配置修改出错,可以还原 3 在以下的红色位置 ...

  8. mybatis xml中大于号小于号的代替

    第一种写法(1): 原符号 < <= > >= & ' "替换符号 < <= > >= & &apos; " ...

  9. Oracle - 单表查询相关

    -- 单表查询 -- 查询表的所有数据, *代表所有 -- select * from [表名]; -- 查询表中指定字段的值 -- select [字段1], [字段2] ... from [表名] ...

  10. sql INSERT语句

    当我们需要向数据库表中插入一条新记录时,就必须使用INSERT语句. INSERT语句的基本语法是: INSERT INTO <表名> (字段1, 字段2, ...) VALUES (值1 ...