Ubuntu 更改 Nginx 版本

1.25 降为 1.18

  1. 先卸载干净
shell 复制代码
# 1. 完全卸载当前Nginx
sudo apt purge nginx nginx-common nginx-core

# 2. 清理残留配置
sudo apt autoremove
sudo rm -rf /etc/apt/sources.list.d/nginx*.list
  1. 修改仓库地址
shell 复制代码
# 添加仓库(通用稳定版仓库)
codename=$(lsb_release -cs)
echo "deb http://nginx.org/packages/ubuntu ${codename} nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
echo "deb-src http://nginx.org/packages/ubuntu ${codename} nginx" | sudo tee -a /etc/apt/sources.list.d/nginx.list
  1. 更新仓库并安装1.18
shell 复制代码
sudo apt update
sudo apt install nginx=1.18.0-1~${codename}
shell 复制代码
nginx -v
# nginx version: nginx/1.18.0
相关推荐
zwxu_6 小时前
Nginx NIO对比Java NIO
java·nginx·nio
FeelTouch Labs7 小时前
Nginx核心架构设计
运维·前端·nginx
MicoZone9 小时前
nginx(更新中)
nginx
Evan芙9 小时前
nginx+php部署walle,发布php站点
运维·nginx·php
The Electronic Cat15 小时前
树莓派安装nginx
运维·chrome·nginx
先生沉默先17 小时前
Docker+Nginx+Node.js 全栈容器化部署
nginx·docker·node.js
Evan芙17 小时前
Nginx安全相关的参数总结
运维·nginx·安全
irisart18 小时前
第一章【基石与起源】—— NGINX 架构设计与工作模式
nginx
猫豆~18 小时前
Nginx代理负载均衡——3day
运维·nginx·负载均衡