CentOS8的Yum倉庫中內置的nginx版本是1.14.1
,最近漏掃提示需要升級至1.17.7
以上版本,記錄一下yum命令使用中科大的鏡像源簡單粗暴有效更新的方法:
先添加中科大的鏡像repo
$ 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