简单粗暴的给Linux系统配置本地yum 源

1:上传镜像,此处镜像名为  jingxiang.iso    上传目录 /tmp

2:mount -o loop /tmp/jingxiang.iso  /mnt

3:编辑配置文件    vim /etc/yum.repos.d/1.repo

  a:linux 7  系统

    [1]
    name=1
    baseurl=file:///mnt
    enabled=1   #启用
    gpgcheck=0  #检查GPG-KEY  0不检查

  b:linux 6 系统

    [1]
    name=1
    baseurl=file:///mnt/Server   #linux7 和 6  系统的一个配置文件位置不同
    enabled=1   #启用
    gpgcheck=0  #检查GPG-KEY  0不检查

4:yum clean all    清除yum 缓存

5:yum makecache   缓存本地yum 源

6:yum list   出现一大坨包名就是了

7:yum install xxx

8:收工。

猜你喜欢

转载自www.cnblogs.com/BWZYDS/p/12340703.html