centos添加nginx官方源

Centos添加官方repo

1. yum查看当前nginx可用包
yum list | grep nginx
2. 添加nginx官方repo
#进入/etc/yum.repos.d/
#新建nginx.repo文件
cd /etc/yum.repos.d
vim nginx.repo
#输入内容
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch
gpgcheck=0
enable=1
3. 查看nginx repo是否成功
yum list | grep nginx
#成功显示
[360iot@Server-c382a248 yum.repos.d]$ yum list | grep nginx
nginx.x86_64                               1.18.0-1.el6.ngx            nginx    
nginx-debug.x86_64                         1.8.0-1.el6.ngx             nginx    
nginx-debuginfo.x86_64                     1.18.0-1.el6.ngx            nginx    
nginx-module-geoip.x86_64                  1.18.0-1.el6.ngx            nginx    
nginx-module-geoip-debuginfo.x86_64        1.18.0-1.el6.ngx            nginx    
nginx-module-image-filter.x86_64           1.18.0-1.el6.ngx            nginx    
nginx-module-image-filter-debuginfo.x86_64 1.18.0-1.el6.ngx            nginx    
nginx-module-njs.x86_64                    1.18.0.0.4.1-1.el6.ngx      nginx    
nginx-module-njs-debuginfo.x86_64          1.18.0.0.4.1-1.el6.ngx      nginx    
nginx-module-perl.x86_64                   1.18.0-1.el6.ngx            nginx    
nginx-module-perl-debuginfo.x86_64         1.18.0-1.el6.ngx            nginx    
nginx-module-xslt.x86_64                   1.18.0-1.el6.ngx            nginx    
nginx-module-xslt-debuginfo.x86_64         1.18.0-1.el6.ngx            nginx    
nginx-nr-agent.noarch                      2.0.0-12.el6.ngx            nginx    
pcp-pmda-nginx.x86_64                      3.10.9-9.el6                base 
5. 查看架构
 arch
 [360iot@Server-c382a248 yum.repos.d]$ arch
x86_64
6. 查看系统大版本
rpm -qi centos-release
[360iot@Server-c382a248 yum.repos.d]$ rpm -qi centos-release
Name        : centos-release               Relocations: (not relocatable)
Version     : 6                                 Vendor: CentOS
Release     : 4.el6.centos.10               Build Date: Mon 25 Feb 2013 04:57:43 PM CST
Install Date: Fri 20 May 2016 06:56:51 PM CST      Build Host: c6b8.bsys.dev.centos.org
Group       : System Environment/Base       Source RPM: centos-release-6-4.el6.centos.10.src.rpm
Size        : 32670                            License: GPLv2
Signature   : RSA/SHA1, Fri 01 Mar 2013 10:01:26 PM CST, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Summary     : CentOS release file
Description :
CentOS release file
6. yum安装nginx
[360iot@Server-c382a248 yum.repos.d]$ yum -y install nginx
7. 查看安装版本号
[360iot@Server-c382a248 yum.repos.d]$ rpm -q nginx
nginx version: nginx/1.18.0
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值