yum源配置(day07)

(一)配置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

  • 10
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值