CentOS7.6 搭建本地yum仓库

CentOS7.6 搭建本地yum仓库

yum源地址:http://mirrors.163.com/centos/7

使用 rsync 命令将x86_64下面的packages全都更新到本地

rsync -avrt --delete rsync://mirrors.163.com/centos/7/os/x86_64/Packages/ /root/rpms/os

更新到本地以后,即可创建元数据了

createrepo -v -p /root/rpms/os

如果rpm仓库内又新增了或者更新了rpm包,执行update命令

createrepo -update /root/rpms/os
yum clean all #清除原来的yum缓存
yum makecache #生成新的yum缓存
yum listrepo #查看支持的repo

创建一个自有源文件

cd /etc/yum.repo.d/
vi custorm.repo
[base]
name=base
baseurl=file:///root/rpms/os
enabled=1
gpgcheck=0

[updates]
name=updates
baseurl=file:///root/rpms/updates
enabled=1
gpgcheck=0

[extras]
name=extras
baseurl=file:///root/rpms/extras
enabled=1
gpgcheck=0

#additional packages that extend functionality of existing packages
[centosplus]
name=centosplus
baseurl=file:///root/rpms/centosplus
gpgcheck=1
enabled=0
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容