本地yum源配置,搭建阿里镜像源,⾃建yum源仓库,安装createrepo制作仓库的软件
创始人
2024-09-25 19:20:35
0

本地yum源配置

配置文件位置:   /etc/yum.repos.d/*.repo

1备份

cd /etc/yum.repos.d/

tar -zcvf repo.tar.gz ./*.repo

2删除所有的repo⽂件

rm -rf /etc/yum.repos.d/*  //虚拟机里清空内容 

3在vmware中装载centos7光盘镜像

4把光盘挂载到指定⽬录下

mkdir  /dvd

mount -o ro /dev/sr0 /dvd

5将挂载添加到开机启动⽂件中

echo 'mount -o ro /dev/sr0 /mnt' >> /etc/rc.local

编辑文件

vim /etc/yum.repos.d/pf.repo   //编辑  以 .repo 结尾的 文件

配置文件内容:
--------------
[dvd]    //仓库标识  ,即仓库的名字    , 不能是中文 ,不能有空格等
name=cetos7.5    //写的是仓库的描述信息
baseurl=file:///dvd     //  指定 本地软件服务器的位置 为  /dvd 
enabled=1     //表示本文件生效 
gpgcheck=0    //不检查红帽签名信息
-------------

6测试是否成功

yum clear all   //  清理缓存

yum makecache       //创建缓存

yum repolist   //列出软件仓库信息如下图   ,表明yum软件仓库搭建成功

搭建阿里镜像源

1.百度搜索阿⾥镜像源

2根据官方提提示配置yum源,在虚拟机执行下面操作

3查看源

yum repolist all

4epel源配置

yum -y install epel-release

5安装⼩⽕⻋

yum -y install sl

sl     //可出现小火车

搭建nginx镜像

1百度搜索nginx.org

2下滑找到documentation,点击

3点击Installing nginx

4点击 packages

5复制红色方框内的内容

6安装稳定版本

vim /etc/yum.repos.d/nginx.repo

粘贴第五步复制的内容进去

7创建缓存

yum clean all

yum makecache

8查看

yum list|grep nginx

9安装并且检查

yum install nginx -y

nginx    //启动服务

whereis nginx     //查看

curl http://localhost    //访问服务器

nginx -s stop      //停⽤nginx   

⾃建yum源仓库

1.缓存安装软件包
下⼀次还⽤
国外源

2.如何缓存
vim /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releaserver # 定义软件包缓存路径
keepcache=1 #开启缓存
debuglevel=2
logfile=/var/log/yum.log
1.vim /etc/yum.cong
2.keepcache=1
3.测试 yum -y. install tree
4./var/cache/yum/x66_32/7/base/packages/treeexxxxxx.rpm
卸载,然后安装nginx 查看缓存⽂件
[root@localhost ~]# vim /etc/yum.conf

3卸载(干净环境)

yum -y remove nginx.x86_64

4安装

yum install nginx -y      安装

find /var/cache/ -name "*nginx*" -type f      //查找安装包

yum install --downloadonly --downloaddir=./softsamba       //只下载不安装

ls soft/

安装createrepo制作仓库的软件

1yum下载

 yum -y install createrepo

2 把soft⽂件夹做成⼀个本地的⾃建仓库

createrepo soft/

3.在/etc/yum.repos.d/下创建soft.repo

rm -rf /etc/yum.repos.d/*.repo      //删除其他仓库⽂件

vim /etc/yum.repos.d/soft.repo      //写入下列五行
[soft]
name=soft_local
gpgcheck=0
baseurl=file:///root/soft
enable=1


yum clean all       //创建缓存
yum makecac  

相关内容

热门资讯

透视神器!wepoker免费透... 透视神器!wepoker免费透视脚本(透视)确实真的有挂(扑克教程)1、wepoker免费透视脚本透...
透视挂!aapoker怎么设置... 透视挂!aapoker怎么设置抽水,aapoker破解侠是真的吗,第三方教程(有挂方法)该软件可以轻...
透视辅助!德普辅助器辅助器怎么... 透视辅助!德普辅助器辅助器怎么用,德普之星透视免费,微扑克教程(有挂方法)1、构建自己的微扑克辅助插...
透视美元局!wepoker免费... 透视美元局!wepoker免费脚本(透视)竟然存在有挂(2025教程);1、这是跨平台的wepoke...
透视数据!aapoker怎么提... 透视数据!aapoker怎么提高中牌率,aapoker怎么开辅助器,爆料教程(有挂细节)一、aapo...
透视app!德普之星私人局辅助... 自定义德普之星私人局辅助免费系统规律,只需要输入自己想要的开挂功能,一键便可以生成出微扑克专用辅助器...
透视辅助!wepoker买脚本... 透视辅助!wepoker买脚本靠谱吗(透视)原来是有挂(科技教程)亲,关键说明,wepoker买脚本...
透视辅助!德扑圈有透视吗,德普... 自定义德普之星透视辅助软件下载系统规律,只需要输入自己想要的开挂功能,一键便可以生成出微扑克专用辅助...
透视安卓版!aapoker脚本... 透视安卓版!aapoker脚本怎么用,aapoker透视脚本,大神讲解(有挂辅助)1)aapoker...
透视了解!wepoker透视a... 透视了解!wepoker透视app下载(透视)确实真的有挂(透牌教程)1、操作简单,无需注册,只需要...