美文网首页
centos7.5利用yum缓存搭建本地源

centos7.5利用yum缓存搭建本地源

作者: 指间_流年 | 来源:发表于2018-11-29 16:15 被阅读0次

    一、环境centos7.5-minimal

    二、设置yum.conf,默认是关闭缓存

    vi /etc/yum.conf    

    keepcache=0改为keepcache=1

    cachedir=/var/cache/yum/    rpm缓存目录

    三、利用网络yum安装相应的包

    例如:yum install tk tcl enca zip unzip vsftpd lftp ntp wget dos2unix vim-enhanced net-tools -y

    安装完毕后,把/var/cache/yum目录下所有rpm包拷贝到某个目录下,比如拷贝到/home/test目录下

    find /var/cache/yum/ -name *.rpm -type f -exec cp {} /home/test/ \;

    四、安装createrepo(创建yum源索引)

    #yum install createrepo -y

    #cd /home 

    #createrepo -v  test

    五、配置本地yum文件

    #cd /etc/yum.repos.d

    #vi test.repo

    #yum clean all

    #yum makecache

    相关文章

      网友评论

          本文标题:centos7.5利用yum缓存搭建本地源

          本文链接:https://www.haomeiwen.com/subject/gvggqqtx.html