离线安装所有可直接yum的服务 离线安装文件可以删除吗
qiyuwang 2024-10-19 08:57 32 浏览 0 评论
公司场景需求:离线服务器上安装一个nginx服务
系统版本:CentOS 7.6
方法一:
使用tar包,二进制安装 略
方法二:
rpm方式
安装rpm包时,应该大家都遇到过缺少依赖包的问题,一个一个安装依赖文件,让人头疼。
这里给大家介绍一种很方便的安装方法
使用yumdownloader命令离线安装 nginx rpm服务包
1.首先找一个可以连接外网的服务器
可以ping通百度域名,确定可以上外网
[root@243-ceshi /]# ping www.baidu.com
PING www.baidu.com
icmp_seq=1 ttl=53 time=23.5 ms
icmp_seq=2 ttl=53 time=22.8 ms
icmp_seq=3 ttl=53 time=27.3 ms
123456
2.安装插件
[root@localhost ~]# yum install yum-utils
3.创建一个存放rpm包的目录
[root@localhost ~]# mkdir /rpm
4.下载nginx rpm相关文件
[root@localhost rpm]# yumdownloader --resolve --destdir=/rpm nginx
5.查看rpm目录下的文件
[root@243-ceshi rpm]# ls
centos-indexhtml-7-9.el7.centos.noarch.rpm nginx-mod-http-image-filter-1.16.1-3.el7.x86_64.rpm
gd-2.0.35-27.el7_9.x86_64.rpm nginx-mod-http-perl-1.16.1-3.el7.x86_64.rpm
gperftools-libs-2.6.1-1.el7.x86_64.rpm nginx-mod-http-xslt-filter-1.16.1-3.el7.x86_64.rpm
libXpm-3.5.12-1.el7.x86_64.rpm nginx-mod-mail-1.16.1-3.el7.x86_64.rpm
nginx-1.16.1-3.el7.x86_64.rpm nginx-mod-stream-1.16.1-3.el7.x86_64.rpm
nginx-all-modules-1.16.1-3.el7.noarch.rpm openssl11-libs-1.1.1g-2.el7.x86_64.rpm
nginx-filesystem-1.16.1-3.el7.noarch.rpm
12345678
nginx最新版本的相关依赖文件全在都rpm目录下了
6.把rpm目录下文件移到内网服务器的/rpm目录下
[root@243-ceshi /]# scp -r /rpm root@192.168.1.168:/rpm
root@192.168.1.168's password:
centos-indexhtml-7-9.el7.centos.noarch.rpm 100% 92KB 19.7MB/s 00:00
gd-2.0.35-27.el7_9.x86_64.rpm 100% 146KB 22.7MB/s 00:00
gperftools-libs-2.6.1-1.el7.x86_64.rpm 100% 272KB 26.2MB/s 00:00
libXpm-3.5.12-1.el7.x86_64.rpm 100% 55KB 17.6MB/s 00:00
nginx-1.16.1-3.el7.x86_64.rpm 100% 563KB 31.4MB/s 00:00
nginx-all-modules-1.16.1-3.el7.noarch.rpm 100% 20KB 8.2MB/s 00:00
nginx-filesystem-1.16.1-3.el7.noarch.rpm 100% 21KB 9.0MB/s 00:00
nginx-mod-http-image-filter-1.16.1-3.el7.x86_64.rpm 100% 30KB 12.0MB/s 00:00
nginx-mod-http-perl-1.16.1-3.el7.x86_64.rpm 100% 39KB 14.3MB/s 00:00
nginx-mod-http-xslt-filter-1.16.1-3.el7.x86_64.rpm 100% 29KB 11.9MB/s 00:00
nginx-mod-mail-1.16.1-3.el7.x86_64.rpm 100% 57KB 16.6MB/s 00:00
nginx-mod-stream-1.16.1-3.el7.x86_64.rpm 100% 85KB 18.1MB/s 00:00
openssl11-libs-1.1.1g-2.el7.x86_64.rpm 100% 1485KB 40.6MB/s 00:00
123456789101112131415
7.进入离线服务器安装
[root@localhost /]# cd /rpm
[root@localhost rpm]# rpm -ivh * --nodeps --force
警告:nginx-1.16.1-3.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 352c64e5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:openssl11-libs-1:1.1.1g-2.el7 ################################# [ 8%]
2:nginx-filesystem-1:1.16.1-3.el7 ################################# [ 15%]
3:libXpm-3.5.12-1.el7 ################################# [ 23%]
4:gd-2.0.35-27.el7_9 ################################# [ 31%]
5:gperftools-libs-2.6.1-1.el7 ################################# [ 38%]
6:centos-indexhtml-7-9.el7.centos ################################# [ 46%]
7:nginx-mod-http-image-filter-1:1.1################################# [ 54%]
8:nginx-mod-http-perl-1:1.16.1-3.el################################# [ 62%]
9:nginx-mod-http-xslt-filter-1:1.16################################# [ 69%]
10:nginx-mod-mail-1:1.16.1-3.el7 ################################# [ 77%]
11:nginx-all-modules-1:1.16.1-3.el7 ################################# [ 85%]
12:nginx-1:1.16.1-3.el7 ################################# [ 92%]
13:nginx-mod-stream-1:1.16.1-3.el7 ################################# [100%]
12345678910111213141516171819
8.启动nginx服务
[root@localhost rpm]# systemctl start nginx
[root@localhost rpm]# systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: active (running) since 四 2021-01-21 15:24:46 CST; 5s ago
Process: 127308 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Process: 127303 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 127300 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Main PID: 127318 (nginx)
Tasks: 7
Memory: 7.8M
CGroup: /system.slice/nginx.service
├─127318 nginx: master process /usr/sbin/nginx
├─127319 nginx: worker process
├─127320 nginx: worker process
├─127322 nginx: worker process
├─127323 nginx: worker process
├─127324 nginx: worker process
└─127325 nginx: worker process
1月 21 15:24:46 vrgv systemd[1]: Starting The nginx HTTP and reverse proxy server...
1月 21 15:24:46 vrgv nginx[127303]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
1月 21 15:24:46 vrgv nginx[127303]: nginx: configuration file /etc/nginx/nginx.conf test is successful
1月 21 15:24:46 vrgv systemd[1]: Started The nginx HTTP and reverse proxy server.
完成
如果有帮助,点个关注吧,还有更多运维技巧分享给您~
相关推荐
- 基于Docker方式安装与部署Camunda流程引擎
-
1Camunda简介官网:https://docs.camunda.org/manual/7.19/installation/docker/Camunda是一个轻量级、开源且高度灵活的工作流和决策自...
- 宝塔Linux面板如何部署Java项目?(宝塔面板 linux)
-
通过宝塔面板部署Java还是很方便的,至少不需要自己输入tomcat之类的安装命令了。在部署java项目前,我还是先说下目前的系统环境,如果和我的系统环境不一样,导致部署不成功,那你可能需要去找其他资...
- 浪潮服务器如何用IPMI安装Linux系统
-
【注意事项】此处以浪潮服务器为例进行演示所需使用的软件:Chrome浏览器个人PC中需要预先安装java,推荐使用jdk-8u181-windows-x64.exe【操作步骤】1、在服务器的BIOS中...
- Centos7环境Hadoop3集群搭建(hadoop集群环境搭建实验报告)
-
由于项目需要存储历史业务数据,经过评估数据量会达到100亿以上,在原有mongodb集群和ES集群基础上,需要搭建Hbase集群进行调研,所以首先总结一下Hadoop集群的搭建过程。一、三个节点的集群...
- Hadoop高可用集群搭建及API调用(hadoop高可用原理)
-
NameNodeHA背景在Hadoop1中NameNode存在一个单点故障问题,如果NameNode所在的机器发生故障,整个集群就将不可用(Hadoop1中虽然有个SecorndaryNameNo...
- 使用Wordpress搭建一个属于自己的网站
-
现在开源的博客很多,但是考虑到wordpress对网站的seo做的很好,插件也多。并且全世界流量排名前1000万的网站有33.4%是用Wordpress搭建的!所以尝试用Wordpress搭建一个网站...
- Centos 安装 Jenkins(centos 安装ssh)
-
1、Java安装查看系统是否已安装Javayumlistinstalled|grepjava...
- Java教程:gitlab-使用入门(java中的git)
-
1导读本教程主要讲解了GitLab在项目的环境搭建和基本的使用,可以帮助大家在企业中能够自主搭建GitLab服务,并且可以GitLab中的组、权限、项目自主操作...
- Dockerfile部署Java项目(docker部署java应用)
-
1、概述本文主要会简单介绍什么是Docker,什么是Dockerfile,如何安装Docker,Dockerfile如何编写,如何通过Dockerfile安装jar包并外置yaml文件以及如何通过do...
- 如何在Eclipse中搭建Zabbix源码的调试和开发环境
-
Zabbix是一款非常优秀的企业级软件,被设计用于对数万台服务器、虚拟机和网络设备的数百万个监控项进行实时监控。Zabbix是开放源码和免费的,这就意味着当出现bug时,我们可以很方便地通过调试源码来...
- Java路径-02-Java环境配置(java环境搭建及配置教程)
-
1Window环境配置1.1下载...
- 35.Centos中安装python和web.py框架
-
文章目录前言1.Centos7python:2.Centos8python:3.进行下载web.py框架然后应用:4.安装好之后进行验证:5.总结:前言...
- 《我的世界》服务器搭建(我的世界服务器如何搭建)
-
1.CentOS7环境1.1更改YUM源#下载YUM源文件curl-o/etc/yum.repos.d/CentOS-Base.repohttps://mirrors.aliyun.com...
- CentOS 7 升级 GCC 版本(centos7.4升级7.5)
-
1.GCC工具介绍GCC编译器:...
- Linux安装Nginx详细教程(linux安装配置nginx)
-
环境准备1.因为Nginx依赖于gcc的编译环境,所以,需要安装编译环境来使Nginx能够编译起来。命令:yuminstallgcc-c++显示完毕,表示安装完成:2.Nginx的http模块需要...
你 发表评论:
欢迎- 一周热门
- 最近发表
-
- 基于Docker方式安装与部署Camunda流程引擎
- 宝塔Linux面板如何部署Java项目?(宝塔面板 linux)
- 浪潮服务器如何用IPMI安装Linux系统
- Centos7环境Hadoop3集群搭建(hadoop集群环境搭建实验报告)
- Hadoop高可用集群搭建及API调用(hadoop高可用原理)
- 使用Wordpress搭建一个属于自己的网站
- Centos 安装 Jenkins(centos 安装ssh)
- Java教程:gitlab-使用入门(java中的git)
- Dockerfile部署Java项目(docker部署java应用)
- 如何在Eclipse中搭建Zabbix源码的调试和开发环境
- 标签列表
-
- navicat无法连接mysql服务器 (65)
- 下横线怎么打 (71)
- flash插件怎么安装 (60)
- lol体验服怎么进 (66)
- ae插件怎么安装 (62)
- yum卸载 (75)
- .key文件 (63)
- cad一打开就致命错误是怎么回事 (61)
- rpm文件怎么安装 (66)
- linux取消挂载 (81)
- ie代理配置错误 (61)
- ajax error (67)
- centos7 重启网络 (67)
- centos6下载 (58)
- mysql 外网访问权限 (69)
- centos查看内核版本 (61)
- ps错误16 (66)
- nodejs读取json文件 (64)
- centos7 1810 (59)
- 加载com加载项时运行错误 (67)
- php打乱数组顺序 (68)
- cad安装失败怎么解决 (58)
- 因文件头错误而不能打开怎么解决 (68)
- js判断字符串为空 (62)
- centos查看端口 (64)