(一)配置yum源
1.将系统yum进行打包备份,打包完成之后把文件中的 .repo 文件删除

2.编辑本地镜像文件


此时使用yum repolist 查看发现并没有安装好我们的yum源

然后检查我们的光盘

发现并没有连接,然后选定连接,选定完成之后进行挂载,在查看就行了

然后用lsblk查看我们的挂载

配置永久挂载、


配置完成之后,自动挂载一下,然后进行查看

(二)配置阿里官方云
1.首先去浏览器搜索阿里云镜像站,找到与我们系统匹配的源进行复制


2.然后回到我们虚拟机,用wget进行下载(没有wget的先下载wget)
wget下载:yum -y install wget

载完成之后先用yum clean all 清除一下,再用yum makecache生成存

3.完成以上步骤之后就可以利用这个yum源查看到我们的python3

(三)下载epel仓库
1.安装
yum -y install epel-release.noarch
2.安装完成之后可以下载一个sl
yum -y install sl
输入sl 可以看见一个小火车

四)安装nginx
1.去nginx.org官网找到centos的源




将上图选中内容进行复制
然后回到我们虚拟机,将多余的yum源删除,然后修改本地yum源
rm -rf /etc/yum.repos.d/*
vim /etc/yum.repos.d/ln.repo

改完成之后清除缓存再yum makecache
yum clean all
yum makecache
2.完成之后就可以直接下载nginx了
yum -y install nginx

然后启动nginx
[root@localhost~]#nginx
查看
[root@localhost~]#whereis nginx

# 访问服务器
[root@localhost ~]# curl http://localhost
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed
and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
# 停⽤nginx
[root@localhost ~]# nginx -s stop
您在 /var/spool/mail/root 中有新邮件
#访问测试
[root@localhost ~]# curl http://localhostcurl: (7) Failed connect to localhost:80; 拒绝连接
五)自建yum仓库
1.配置文件定义软件包缓存路径
[root@localhost ~]#vim /etc/yum.conf

2.卸载nginx,然后安装nginx 查看缓存⽂件
[root@localhost ~]#yum -y remove nginx

[root@localhost ~]#yum -y install nginx
#查找安装包

3.只下载不安装

4.安装createrepo制作仓库的软件

5.把soft⽂件夹做成⼀个本地的⾃建仓库
root@localhost ~]# createrepo soft/
Spawning worker 0 with 19 pkgs
Workers FinishedSaving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@localhost ~]# cd soft/
6.在/etc/yum.repos.d/下创建 soft.repo
root@localhost ~]# vim /etc/yum.repos.d/soft.repo
[soft]
name=soft_local
gpgcheck=0
baseurl=file:///root/soft
enable=1
root@localhost ~]# yum clean all
# 再次安装samba

