yum源

一.管理软件包

  1. 使用yum安装一个软件

  #yum -y install  软件包名

  1. yum加入epel源

  #wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

 #curl http://mirrors.aliyun.com/repo/Centos-7.repo > /etc/yum.repos.d/CentOS-Base.repo(阿里源)

#注:更新后的yum地址 http://vault.centos.org/

  #yum clean all  

#yum makecache  (缓存在本地)

  #yum repolist all

 

  1. 如何配置yum,使其使用本地目录源。

  #vim /etc/yum.conf

   gpgcheck=0 (不检查)

  #yum -y install createrepo 构建yum源命令

  #createrepo 包的绝对路径

  # yum-config-manager --add file://包的绝对路径

  #yum clean all

  #yum repolist all

  #createrepo --update 之后再有新加入包执行这个即可

 

  1. 如何配置 yum,使其使用本地 ISO 文件作为源

  #echo /dev/cdrom  /mnt/iso iso9660 defaults  0 0>>/etc/fstab 挂载ios镜像文件

  #yum-config-manager --add file:///mnt/iso

  #yum clean all

#yum repolist all

 

 

 

 

posted @ 2018-06-01 10:18  wwchihiro  阅读(111)  评论(0编辑  收藏  举报