linux运维

Centos8--本地yum源配置及使用dnf命令安装nginx

2019-10-16  本文已影响0人  疯疯疯子子子

背景

[root@localhost yum.repos.d]# ls /mnt/median/
AppStream  BaseOS  EFI  images  isolinux  media.repo  TRANS.TBL
[root@localhost yum.repos.d]# rm -rf /etc/yum.repos.d/*.repo
[root@localhost yum.repos.d]# cat /etc/yum.repos.d/base.repo
[base]
name=base
gpgcheck=0
enabled=1
baseurl=file:///mnt/median/BaseOS


[AppStream]
name=AppStream
gpgcheck=0
enabled=1
baseurl=file:///mnt/median/AppStream

[root@localhost yum.repos.d]# dnf clean all && dnf makecache
12 文件已删除
AppStream                                                                                                                                                                   122 MB/s | 5.2 MB     00:00
base                                                                                                                                                                        102 MB/s | 2.2 MB     00:00
元数据缓存已建立。
[root@localhost yum.repos.d]# dnf install nginx -y
上次元数据过期检查:0:03:13 前,执行于 2019年10月15日 星期二 21时43分32秒。
依赖关系解决。
================================================================================
 软件包             架构   版本                                 仓库       大小
================================================================================
Installing:
 nginx              x86_64 1:1.14.1-8.module_el8.0.0+5+258f653c AppStream 569 k
安装依赖关系:
 nginx-all-modules  noarch 1:1.14.1-8.module_el8.0.0+5+258f653c AppStream  23 k
 nginx-filesystem   noarch 1:1.14.1-8.module_el8.0.0+5+258f653c AppStream  24 k
 nginx-mod-http-image-filter
                    x86_64 1:1.14.1-8.module_el8.0.0+5+258f653c AppStream  34 k
 nginx-mod-http-perl
                    x86_64 1:1.14.1-8.module_el8.0.0+5+258f653c AppStream  45 k
 nginx-mod-http-xslt-filter
                    x86_64 1:1.14.1-8.module_el8.0.0+5+258f653c AppStream  33 k
 nginx-mod-mail     x86_64 1:1.14.1-8.module_el8.0.0+5+258f653c AppStream  64 k
 nginx-mod-stream   x86_64 1:1.14.1-8.module_el8.0.0+5+258f653c AppStream  85 k
Enabling module streams:
 nginx                     1.14

事务概要
================================================================================
安装  8 软件包

总计:877 k
安装大小:2.0 M
下载软件包:
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
  准备中      :                                                             1/1
  运行脚本    : nginx-filesystem-1:1.14.1-8.module_el8.0.0+5+258f653c.noa   1/8
  Installing  : nginx-filesystem-1:1.14.1-8.module_el8.0.0+5+258f653c.noa   1/8
  Installing  : nginx-mod-http-image-filter-1:1.14.1-8.module_el8.0.0+5+2   2/8
  运行脚本    : nginx-mod-http-image-filter-1:1.14.1-8.module_el8.0.0+5+2   2/8
  Installing  : nginx-mod-http-perl-1:1.14.1-8.module_el8.0.0+5+258f653c.   3/8
  运行脚本    : nginx-mod-http-perl-1:1.14.1-8.module_el8.0.0+5+258f653c.   3/8
  Installing  : nginx-mod-http-xslt-filter-1:1.14.1-8.module_el8.0.0+5+25   4/8
  运行脚本    : nginx-mod-http-xslt-filter-1:1.14.1-8.module_el8.0.0+5+25   4/8
  Installing  : nginx-mod-mail-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_6   5/8
  运行脚本    : nginx-mod-mail-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_6   5/8
  Installing  : nginx-all-modules-1:1.14.1-8.module_el8.0.0+5+258f653c.no   6/8
  Installing  : nginx-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64           7/8
  运行脚本    : nginx-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64           7/8
  Installing  : nginx-mod-stream-1:1.14.1-8.module_el8.0.0+5+258f653c.x86   8/8
  运行脚本    : nginx-mod-stream-1:1.14.1-8.module_el8.0.0+5+258f653c.x86   8/8
  验证        : nginx-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64           1/8
  验证        : nginx-all-modules-1:1.14.1-8.module_el8.0.0+5+258f653c.no   2/8
  验证        : nginx-filesystem-1:1.14.1-8.module_el8.0.0+5+258f653c.noa   3/8
  验证        : nginx-mod-http-image-filter-1:1.14.1-8.module_el8.0.0+5+2   4/8
  验证        : nginx-mod-http-perl-1:1.14.1-8.module_el8.0.0+5+258f653c.   5/8
  验证        : nginx-mod-http-xslt-filter-1:1.14.1-8.module_el8.0.0+5+25   6/8
  验证        : nginx-mod-mail-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_6   7/8
  验证        : nginx-mod-stream-1:1.14.1-8.module_el8.0.0+5+258f653c.x86   8/8

已安装:
  nginx-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
  nginx-all-modules-1:1.14.1-8.module_el8.0.0+5+258f653c.noarch
  nginx-filesystem-1:1.14.1-8.module_el8.0.0+5+258f653c.noarch
  nginx-mod-http-image-filter-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
  nginx-mod-http-perl-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
  nginx-mod-http-xslt-filter-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
  nginx-mod-mail-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64
  nginx-mod-stream-1:1.14.1-8.module_el8.0.0+5+258f653c.x86_64

完毕!
[root@localhost yum.repos.d]# systemctl start nginx
[root@localhost yum.repos.d]# systemctl enable nginx.service
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
[root@localhost yum.repos.d]# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2019-10-15 21:47:39 EDT; 37min ago
 Main PID: 50706 (nginx)
    Tasks: 3 (limit: 11357)
   Memory: 9.2M
   CGroup: /system.slice/nginx.service
           ├─50706 nginx: master process /usr/sbin/nginx
           ├─50707 nginx: worker process
           └─50708 nginx: worker process

10月 15 21:47:39 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...
10月 15 21:47:39 localhost.localdomain nginx[50703]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
10月 15 21:47:39 localhost.localdomain nginx[50703]: nginx: configuration file /etc/nginx/nginx.conf test is successful
10月 15 21:47:39 localhost.localdomain systemd[1]: Started The nginx HTTP and reverse proxy server.
上一篇 下一篇

猜你喜欢

热点阅读