赞
踩
CentOS8的Yum仓库中内置的nginx版本是1.14.1
,最近漏扫提示需要升级至1.17.7
以上版本,记录一下yum命令使用中科大的镜像源简单粗暴有效更新的方法:
$ sudo vim /etc/yum.repos.d/nginx.repo
使用mainline最新版本的repo
[nginx-mainline]
name=nginx mainline repo
baseurl=http://mirrors.ustc.edu.cn/nginx/mainline/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
module_hotfixes=true
$ sudo yum update Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Repository PowerTools is listed more than once in the configuration Repository AppStream is listed more than once in the configuration nginx mainline repo 2.1 kB/s | 34 kB 00:16 Dependencies resolved. =============================================================================================================================================================================================================== Package Architecture Version Repository Size =============================================================================================================================================================================================================== Upgrading: nginx x86_64 1:1.17.10-1.el8.ngx nginx-mainline 806 k Transaction Summary =============================================================================================================================================================================================================== Upgrade 1 Package Total download size: 806 k Is this ok [y/N]:y
$ nginx -v
nginx version: nginx/1.17.10
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。