简介
mysql-community-common-5.7.12-1.el7.x86_64.rpm
RPM 包
zip-3.0-11.el7.x86_64.rpm
# zip — 软件包名
# 3.0-11 — 版本号(Version)
# el7 — 发布版本(Release5/6/7)
# x86_64 — 系统平台(32/64)
# rpm — 文件后缀
简介
nginx-1.8.1.tar.gz
源码包
nginx-1.8.1.tar.gz
# nginx — 包名
# 1.8.1 — 版本号
# tar.gz — 压缩格式
简介
简介
具体步骤
ll /etc/yum.repos.d/*
[root@localhost yum.repos.d]# mv /etc/yum.repos.d/* /tmp
[root@localhost yum.repos.d]# ll /tmp/* | grep repo
-rw-r--r--. 1 root root 2523 12月 26 19:31 /tmp/CentOS-Base.repo
[root@localhost yum.repos.d]# ls
[root@localhost yum.repos.d]# touch 1.repo
[root@localhost yum.repos.d]# vim 1.repo
# 1.repo 文本内容
[1]
name=1
baseurl=file:///mnt/cdrom
gpgcheck=0
# 注释
# /etc/yum.repos.d/ 是 YUM 下载地址库目录
# [1]某一个库的名称,中括号 [] 是必须的
# name=1 是库的说明,name 是必须的
# baseurl=file:///mnt/cdrom 下载库的具体地址
# gpgcheck=0 是关闭校验
# 1. 创建挂载点
[root@localhost ~]# mkdir /mnt/cdrom
# 2. 查看挂载文件
[root@localhost ~]# ls /dev | grep cdrom
cdrom
# 3. 挂载
[root@localhost ~]# mount /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 写保护,将以只读方式挂载
mount: /dev/sr0 已经挂载或 /mnt/cdrom 忙
/dev/sr0 已经挂载到 /mnt/cdrom 上
# 4. 查看挂载点目录
[root@localhost ~]# ls /mnt/cdrom/
CentOS_BuildTag GPL LiveOS RPM-GPG-KEY-CentOS-7
EFI images Packages RPM-GPG-KEY-CentOS-Testing-7
EULA isolinux repodata TRANS.TBL
# 设置开机自启动挂载
[root@localhost ~]# vim /root/.bashrc
# 写入内容:mount /dev/cdrom /mnt/cdrom
使用 YUM 安装文件并验证
[root@localhost yum.repos.d]# yum -y install httpd
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
1 | 3.6 kB 00:00:00
(1/2): 1/group_gz | 153 kB 00:00:00
(2/2): 1/primary_db | 3.3 MB 00:00:00
匹配 httpd-2.4.6-95.el7.centos.x86_64 的软件包已经安装。正在检查更新。
无须任何处理
[root@localhost yum.repos.d]#
# 2. 启动软件, 关闭防火墙, 关闭防火墙自启
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
[root@localhost /]# yum repolist
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
源标识 源名称 状态
1 1 4,070
repolist: 4,070
目的
具体步骤
[root@localhost yum.repos.d]# yum install wget
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
软件包 wget-1.14-18.el7_6.1.x86_64 已安装并且是最新版本
无须任何处理
[root@localhost yum.repos.d]# mv 1.repo /tmp
[root@localhost yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
--2021-04-16 17:04:02-- http://mirrors.aliyun.com/repo/Centos-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 119.36.224.241, 119.36.224.239, 119.36.224.248, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|119.36.224.241|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2523 (2.5K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”
100%[=================================================================================================================================>] 2,523 --.-K/s 用时 0s
2021-04-16 17:04:02 (268 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2523/2523])
# 1. 查看 YUM 源
[root@localhost yum.repos.d]# yum repolist
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
源标识 源名称 状态
base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 10,072
extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 468
updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 1,924
repolist: 12,464
# 2. 重建缓存
[root@localhost yum.repos.d]# yum makecache
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/6): extras/7/x86_64/other_db | 138 kB 00:00:00
(2/6): extras/7/x86_64/filelists_db | 230 kB 00:00:00
(3/6): updates/7/x86_64/other_db | 555 kB 00:00:02
(4/6): base/7/x86_64/other_db | 2.6 MB 00:00:06
(5/6): base/7/x86_64/filelists_db | 7.2 MB 00:00:09
(6/6): updates/7/x86_64/filelists_db | 4.2 MB 00:00:10
元数据缓存已建立
简介:额外软件包
具体步骤
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
--2021-04-16 17:08:58-- http://mirrors.aliyun.com/repo/epel-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 119.36.224.242, 119.36.225.226, 119.36.224.208, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|119.36.224.242|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:664 [application/octet-stream]
正在保存至: “/etc/yum.repos.d/epel.repo”
100%[=================================================>] 664 --.-K/s 用时 0s
2021-04-16 17:08:58 (145 MB/s) - 已保存 “/etc/yum.repos.d/epel.repo” [664/664])
[root@localhost yum.repos.d]# yum makecache
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/6): epel/x86_64/group_gz | 96 kB 00:00:00
(2/6): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(3/6): epel/x86_64/prestodelta | 869 B 00:00:00
(4/6): epel/x86_64/primary_db | 6.9 MB 00:00:09
(5/6): epel/x86_64/other_db | 3.3 MB 00:00:09
(6/6): epel/x86_64/filelists_db | 12 MB 00:00:20
元数据缓存已建立
yum -y install httpd
yum -y reinstall httpd
yum -y update httpd
yum repolist
yum list httpd
(带 @ 的表示已经安装)[root@localhost ~]# yum list httpd
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
已安装的软件包
httpd.x86_64 2.4.6-97.el7.centos @updates
yum -y remove httpd
[root@localhost ~]# yum -y remove httpd
已加载插件:fastestmirror, langpacks
正在解决依赖关系
--> 正在检查事务
---> 软件包 httpd.x86_64.0.2.4.6-97.el7.centos 将被 删除
--> 解决依赖关系完成
依赖关系解决
===========================================================================================
Package 架构 版本 源 大小
===========================================================================================
正在删除:
httpd x86_64 2.4.6-97.el7.centos @updates 9.4 M
事务概要
===========================================================================================
移除 1 软件包
安装大小:9.4 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 数据库已被非 yum 程序修改。
正在删除 : httpd-2.4.6-97.el7.centos.x86_64 1/1
验证中 : httpd-2.4.6-97.el7.centos.x86_64 1/1
删除:
httpd.x86_64 0:2.4.6-97.el7.centos
完毕!
[root@localhost ~]# yum list httpd
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
可安装的软件包
httpd.x86_64 2.4.6-97.el7.centos update
前言
具体步骤
[root@localhost ~]# cd /mnt/cdrom/Packages
[root@localhost Packages]# ls wget-1.14-18.el7_6.1.x86_64.rpm
wget-1.14-18.el7_6.1.x86_64.rpm
[root@localhost Packages]# rpm -ivh wget-1.14-18.el7_6.1.x86_64.rpm
准备中... ################################# [100%]
软件包 wget-1.14-18.el7_6.1.x86_64 已经安装
[root@localhost Packages]# rpm -q wget
wget-1.14-18.el7_6.1.x86_64
[root@localhost Packages]# rpm -evh wget-1.14-18.el7_6.1.x86_64
准备中... ################################# [100%]
正在清理/删除...
1:wget-1.14-18.el7_6.1 ################################# [100%]
[root@localhost Packages]# rpm -q wget
未安装软件包 wget
具体步骤
wget http://tengine.taobao.org/download/tengine-2.2.0.tar.gz
yum -y install gcc make zlib-devel pcre pcre-devel openssl-devel
tar xvf tengine-2.2.0.tar.gz
[root@localhost ~]# ls
anaconda-ks.cfg tengine-2.2.0 公共 视频 文档 音乐
initial-setup-ks.cfg tengine-2.2.0.tar.gz 模板 图片 下载 桌面
[root@localhost ~]# cd tengine-2.2.0/
[root@localhost tengine-2.2.0]# useradd xiaohan
[root@localhost tengine-2.2.0]# ./configure --user=xiaohan --group=xiaohan --prefix=/usr/local/nginx
checking for OS
+ Linux 3.10.0-1160.24.1.el7.x86_64 x86_64
checking for C compiler ... found
+ using GNU C compiler
+ gcc version: 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
checking for gcc -pipe switch ... found
......
make
make install
# 1. 若之前启动过 httpd 服务
[root@localhost tengine-2.2.0]# systemctl stop httpd
# 2. 启动服务
[root@localhost tengine-2.2.0]# /usr/local/nginx/sbin/nginx
# 3. 关闭防火墙
[root@localhost tengine-2.2.0]# systemctl stop firewalld
# 4. 打开浏览器, 输入 127.0.0.1