有时候我们需要制作本地yumyum源,可以将对能联网的机器的yum安装后的安装文件缓存起来,利用下载的安装文件,通过createrepo工具制作成本地的yum仓库。

修改/etc/yum.conf里面的参数keepcache,从0改为1

[root@k8smaster01 ~]# more /etc/yum.conf 
[main]
cachedir=/var/cache/yum/$basearch/$releasever  下载的RPM包的缓存目录
keepcache=1  设置缓存是否保存,1保存,0不保存。
debuglevel=2  调试级别(0-10),默认为2
logfile=/var/log/yum.log  yum的日志文件所在的位置
exactarch=1  在更新的时候,是否允许更新不同版本的RPM包,比如是否在i386上更新i686的RPM包
obsoletes=1 这是一个update的参数,具体请参阅yum(8),简单的说就是相当于upgrade,允许更新陈旧的RPM包。
gpgcheck=1  是否检查GPG(GNU Private Guard),一种密钥方式签名。
plugins=1  是否允许使用插件,默认是0不允许,但是我们一般会用yum-fastestmirror这个插件
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release


#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
You have new mail in /var/spool/mail/root
[root@k8smaster01 ~]# 
 

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐