1.插⼊优盘,读取优盘数据
指令
结果
2.在vmware配置光盘iso⽂件,在linux系统中读取光盘⽂件
指令[root@localhost ~]# mount /dev/sr0 /mnt/ -o ro
结果[root@localhost ~]# ls /mnt/
CentOS_BuildTag EULA images LiveOS repodata RPM
GPG-KEY-CentOS-Testing-7
EFI GPL isolinux Packages RPM-GPG-KEY-CentOS-7
TRANS.TBL
3.配置阿⾥云yum仓库
指令[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo
https://mirrors.aliyun.com/repo/Centos-7.repo
[root@localhost yum.repos.d]# yum repolist all
已加载插件:fastestmirror
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
centosplus/7/x86_64 CentOS-7 - Plus -
mirrors.aliyun.com 禁⽤
contrib/7/x86_64 CentOS-7 - Contrib -
mirrors.aliyun.com 禁⽤
extras/7/x86_64 CentOS-7 - Extras -
mirrors.aliyun.com 启⽤: 526
local local0
启⽤: 9,911
updates/7/x86_64 CentOS-7 - Updates -
mirrors.aliyun.com 启⽤: 6,173
repolist: 26,682
结果[root@localhost yum.repos.d]# yum -y install httpd
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
正在解决依赖关系--> 正在检查事务---> 软件包 httpd.x86_64.0.2.4.6-99.el7.centos.1 将被 安装--> 解决依赖关系完成
依赖关系解决
=======================================================================
=========================================
Package 架构 版本
源 ⼤⼩
=======================================================================
=========================================
正在安装:
2.特定软件 nginx mysql zabbix
httpd x86_64 2.4.6-99.el7.centos.1
updates 2.7 M
事务概要
=======================================================================
=========================================
安装 1 软件包
总下载量:2.7 M
安装⼤⼩:9.4 M
Downloading packages:
httpd-2.4.6-99.el7.centos.1.x86_64.rpm
| 2.7 MB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : httpd-2.4.6-99.el7.centos.1.x86_64
1/1
验证中 : httpd-2.4.6-99.el7.centos.1.x86_64
1/1
已安装:
httpd.x86_64 0:2.4.6-99.el7.centos.1
4.配置清华镜像仓库
指令[root@localhost ~]# vim /etc/yum.repos.d/CentOS-7.repo
[base]
name=CentOS-7
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.5.1804/os/x86_64/
enabled=1
gpgcheck=0
结果[root@localhost ~]# yum makecache
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
base
(1/4): base/group_gz
(2/4): base/primary_db
(3/4): base/other_db
(4/4): base/filelists_db
元数据缓存已建立
[root@localhost ~]# yum -y install httpd
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 httpd.x86_64.0.2.4.6-80.el7.centos 将被 安装
--> 解决依赖关系完成
依赖关系解决
=================================================================================
Package 架构 版本 源 大小
=================================================================================
正在安装:
httpd x86_64 2.4.6-80.el7.centos base 2.7 M
事务概要
=================================================================================
安装 1 软件包
总下载量:2.7 M
安装大小:9.4 M
Downloading packages:
httpd-2.4.6-80.el7.centos.x86_64.rpm | 2.7 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : httpd-2.4.6-80.el7.centos.x86_64 1/1
验证中 : httpd-2.4.6-80.el7.centos.x86_64 1/1
已安装:
httpd.x86_64 0:2.4.6-80.el7.centos
完毕!
5.配置腾讯镜像仓库
指令[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo
http://mirrors.cloud.tencent.com/repo/centos7_base.repo
结果[root@localhost ~]# yum makecache
已加载插件:fastestmirror
Determining fastest mirrors
extras
| 2.9 kB 00:00:00
local
| 3.6 kB 00:00:00
os
| 3.6 kB 00:00:00
updates
| 2.9 kB 00:00:00
(1/14): extras/7/x86_64/primary_db
| 253 kB 00:00:00
(2/14): local/group_gz
| 166 kB 00:00:00
(3/14): extras/7/x86_64/other_db
| 154 kB 00:00:00
(4/14): local/primary_db
| 5.9 MB 00:00:00
(5/14): local/filelists_db
| 6.9 MB 00:00:00
(6/14): local/other_db
| 2.5 MB 00:00:00
(7/14): extras/7/x86_64/filelists_db
| 305 kB 00:00:01
(8/14): os/7/x86_64/group_gz
| 153 kB 00:00:00
(9/14): os/7/x86_64/primary_db
| 6.1 MB 00:00:03
(10/14): os/7/x86_64/other_db
| 2.6 MB 00:00:02
(11/14): os/7/x86_64/filelists_db
| 7.2 MB 00:00:06
(12/14): updates/7/x86_64/filelists_db
| 15 MB 00:00:12
(13/14): updates/7/x86_64/other_db
| 1.6 MB 00:00:02
(14/14): updates/7/x86_64/primary_db
| 27 MB 00:00:20
元数据缓存已建⽴
6.⾃建仓库 包含 tree net-tools bash-completion nginx tree等
指令vim /etc/yum.conf
keepcache=1
[root@localhost ~]# yum install --downloadonly --downloaddir=./soft
Tree net-tools bash-completion nginx
[root@localhost ~]# yum -y install createrepo
[root@localhost ~]# createrepo soft/
vim /etc/yum.repos.d/soft.repo
[soft]
name=soft_local
gpgcheck=0
baseurl=file:///root/soft
enable=1
[root@localhost soft]# yum clean all
[root@localhost soft]# yum makecache
结果
[root@localhost ~]# yum install net-tools -y
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 net-tools.x86_64.0.2.0-0.22.20131004git.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
=================================================================================
Package 架构 版本 源 大小
=================================================================================
正在安装:
net-tools x86_64 2.0-0.22.20131004git.el7 soft 305 k
事务概要
=================================================================================
安装 1 软件包
总下载量:305 k
安装大小:917 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : net-tools-2.0-0.22.20131004git.el7.x86_64 1/1
验证中 : net-tools-2.0-0.22.20131004git.el7.x86_64 1/1
已安装:
net-tools.x86_64 0:2.0-0.22.20131004git.el7
完毕!