【内网】服务器升级nginx1.17.0
创始人
2024-09-26 04:20:38
0

今天用rpm包升级内网nginx版本,上来就给我报错

警告:nginx-1.27.0-2.el7.ngx.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 7bd9bf62: NOKEY
错误:依赖检测失败:
    libcrypto.so.10()(64bit) 被 nginx-1:1.27.0-2.el7.ngx.x86_64 需要
    libcrypto.so.10(OPENSSL_1.0.2)(64bit) 被 nginx-1:1.27.0-2.el7.ngx.x86_64 需要
    libcrypto.so.10(libcrypto.so.10)(64bit) 被 nginx-1:1.27.0-2.el7.ngx.x86_64 需要
    libssl.so.10()(64bit) 被 nginx-1:1.27.0-2.el7.ngx.x86_64 需要
    libssl.so.10(libssl.so.10)(64bit) 被 nginx-1:1.27.0-2.el7.ngx.x86_64 需要

根据文章error: Failed dependencies libcrypto.so.10()(64bit) is needed, libssl.so.10()(64bit) is needed-CSDN博客 去

https://pkgs.org/download/libcrypto.so.10()(64bit)

 下载新的包并且安装

然后又报了新的错

file /etc/logrotate.d/nginx from install of nginx-1:1.27.0-2.el7.ngx.x86_64 conflicts with file from package nginx-1:1.21.5-2.p01.ky10.x86_64
    file /etc/nginx/nginx.conf from install of nginx-1:1.27.0-2.el7.ngx.x86_64 conflicts with file from package nginx-1:1.21.5-2.p01.ky10.x86_64
    file /usr/lib/systemd/system/nginx.service from install of nginx-1:1.27.0-2.el7.ngx.x86_64 conflicts with file from package nginx-1:1.21.5-2.p01.ky10.x86_64
    file /usr/sbin/nginx from install of nginx-1:1.27.0-2.el7.ngx.x86_64 conflicts with file from package nginx-1:1.21.5-2.p01.ky10.x86_64
    file /usr/share/nginx/html/50x.html from install of nginx-1:1.27.0-2.el7.ngx.x86_64 conflicts with file from package nginx-1:1.21.5-2.p01.ky10.x86_64
    file /usr/share/nginx/html/index.html from install of nginx-1:1.27.0-2.el7.ngx.x86_64 conflicts with file from package nginx-1:1.21.5-2.p01.ky10.x86_64
    file /var/log/nginx from install of nginx-1:1.27.0-2.el7.ngx.x86_64 conflicts with file from package nginx-1:1.21.5-2.p01.ky10.x86_64

 看意思是旧的nginx包依赖和新的包依赖冲突了

把旧的依赖包删了安装新的依赖包


整合脚本如下

#!/bin/bash  # 定义rpm包文件名 RPM_FILE="nginx-1.27.0-2.el7.ngx.x86_64.rpm"  # 检查是否为root用户 if [ "$EUID" -ne 0 ]; then   echo "请使用root权限运行此脚本。"   exit 1 fi  # 检查RPM文件是否存在 if [ ! -f "$RPM_FILE" ]; then   echo "找不到文件 $RPM_FILE。请确保文件存在并重试。"   exit 1 fi  # 备份当前配置文件 cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak cp -r /usr/lib64/nginx/modules/ /usr/lib64/nginx/modules_bak/ rm -rf modules  # 安装依赖 rpm -ivh "compat-openssl10-1.0.2o-8.ky10.x86_64.rpm" echo "正在安装nginx..."  # 依赖包覆盖安装新的nginx rpm -ivh --replacefiles "$RPM_FILE" # 检查安装是否成功 if [ $? -eq 0 ]; then   echo "nginx安装成功!" else   echo "nginx安装失败。请检查错误信息。"   exit 1 fi  # 启动nginx服务 echo "正在启动nginx服务..."  /usr/sbin/nginx -c /etc/nginx/nginx.conf /usr/sbin/nginx -s reload systemctl daemon-reload systemctl restart nginx   # 设置nginx开机自启动 echo "正在设置nginx开机自启动..." systemctl enable nginx  echo "nginx安装和配置完成。" 

相关内容

热门资讯

辅助透视!hhpoker透视方... 辅助透视!hhpoker透视方法(透视)奇迹手游免费辅助(都是存在有辅助下载)-哔哩哔哩1、奇迹手游...
黑科技辅助挂!拱趴大菠萝作必弊... 黑科技辅助挂!拱趴大菠萝作必弊方法(透视)微乐小程序外辅助工具(一贯真的有辅助方法)-哔哩哔哩1、用...
透视了解!金州水鱼脚本(辅助)... 透视了解!金州水鱼脚本(辅助)宁波游戏大厅本来存在有辅助app(哔哩哔哩)进入游戏-大厅左侧-新手福...
昨日!德州局脚本(透视)鱼乐达... 昨日!德州局脚本(透视)鱼乐达人辅助工具下载(辅助)一贯存在有插件(哔哩哔哩)1、很好的工具软件,可...
于此同时!wepoker怎么获... 于此同时!wepoker怎么获得好牌(透视)wepoker辅助器免费(总是真的是有辅助安装)-哔哩哔...
黑科技技巧!菠萝辅助器免费版的... 黑科技技巧!菠萝辅助器免费版的特点(透视)微乐小程序自建房透视免费(一直真的是有辅助工具)-哔哩哔哩...
解谜了解!阿拉透视辅助器(辅助... 解谜了解!阿拉透视辅助器(辅助)响水麻将原来有挂辅助工具(哔哩哔哩)1、完成阿拉透视辅助器辅助器v3...
出现新变化!哈糖大菠萝怎么挂(... 您好,哈糖大菠萝怎么挂这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302】很多玩...
透视黑科技!sohoo pok... 透视黑科技!sohoo poker辅助器(透视)心悦填大坑辅助(其实真的有辅助安装)-哔哩哔哩1、下...
第三方辅助挂!wpk真吗(透视... 第三方辅助挂!wpk真吗(透视)微信小程序微乐跑得快技巧(本来真的是有辅助器)-哔哩哔哩1、下载好w...