yum

 

使用阿里yun源

mv /etc/yum.repos.d/* /etc/yum.repos.d/back
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 
(curl -O http://mirrors.aliyun.com/repo/Centos-7.repo )

yum clean all

yum makecache

yum -y update

 

 

 

 

1.搭建Yum服务端(这里假设服务器ip地址为ip)

  >>>搭建ftp服务

    安装 vsftpd

  >>>查看镜像文件绝对路径:

    ls -l /iso

    /var/lib/libvirt/images/iso

  >>>开机自动挂载镜像文件

    vim /etc/fstab

    /var/lib/libvirt/images/iso/rhel-server-7.4-x86_64-dvd.iso  /var/ftp/rhel7  iso9660  defaults 0 0

    测试:firefox ftp://ip/rhel7

2.客户端

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

  [rhel7]

  name=rhel7

  baseurl=ftp://ip/rhel7

  enabled=1

  gpgcheck=0

  

  yum repolist

 

自建yum

1.将搜集到的.rpm包存放在指定目录eg: /tools/others

2.创建仓库档案repodata

  createrepo /tools/others

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

    [myYum]

    name=other

    baseurl=file:///tools/other      #声明本地机器为Yum服务端

    enabled=1

    gpgcheck=0

  yum repolist

 

posted @ 2018-12-08 22:32  Ray_chen  阅读(133)  评论(0编辑  收藏  举报