1插入优盘,读取优盘数据
2.在VMware配置光盘iso文件,在Linux系统中读取光盘文件
3.配置阿里云yum仓库
https://developer.aliyun.com/mirror/centos //查找帮助文档
[root@2 ~]# ls /etc/yum.repos.d
hh.repo
[root@2 ~]# mv /etc/yum.repos.d/hh.repo /etc/yum.repos.d/hh.repo.backup
[root@2 ~]# ls /etc/yum.repos.d/
hh.repo.backup
[root@2 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
[root@2 ~]# ls /etc/yum.repos.d/
CentOS-Base.repo hh.repo.backup
[root@2 ~]# yum clean all
[root@2 ~]# yum makecache
[root@2 ~]# yum repolist
4.配置清华镜像文件
https://mirrors.tuna.tsinghua.edu.cn/help/pypi/ //查找帮助文档
[root@2 ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOSBase.repo.backup [root@2 ~]# ls /etc/yum.repos.d/
CentOS-Base.repo.backup hh.repo.backup
5.配置腾讯镜像仓库
https://mirrors.tencent.com/
[root@2 ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOSBase.repo.backup [root@2 ~]# ls /etc/yum.repos.d/
CentOS-Base.repo.backup hh.repo.backup
[root@2 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
[root@2 ~]# yum clean all
[root@2 ~]# yum makecache
[root@2 ~]# yum repolist
6.自建仓库 包含tree net-tools bash-completion nginx 等包
vim /etc/yum.conf
将keepcache后改为1
yum install --downloadonly --downloaddir=./soft net-tools
yum install --downloadonly --downloaddir=./soft bash-completion
yum install --downloadonly --downloaddir=./soft nginx
yum install --downloadonly --downloaddir=./soft tree
[root@2 ~]# ls soft/
bash-completion-2.1-8.el7.noarch.rpm net-tools-2.0- 0.25.20131004git.el7.x86_64.rpm
[root@2 ~]# yum -y install createrepo
[root@2 ~]# createrepo ./soft/
[root@2 ~]# ls soft/
bash-completion-2.1-8.el7.noarch.rpm net-tools-2.0- 0.25.20131004git.el7.x86_64.rpm repodata nginx-1.26.1-2.el7.ngx.x86_64.rpm tree-1.6.0-10.el7.x86_64.rpm
[root@2 ~]# mv /etc/yum.repos.d/CentOS-Base.repo.repo
/etc/yum.repos.d/CentOS-Base.repo.txt
[root@2 ~]# mv /etc/yum.repos.d/nginx.repo /etc/yum.repos.d/nginx.repo.txt
[root@2 ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOSBase.repo.txt [root@2 ~]# yum clean all
[root@2 ~]# yum makecache
[root@2 ~]# yum -y install bash-completion.noarch
[root@2 ~]# yum -y install net-tools.x86_64
[root@2 ~]# yum -y install nginx
[root@2 ~]# yum -y install tree