服务搭建第0步之YUM配置
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了服务搭建第0步之YUM配置相关的知识,希望对你有一定的参考价值。
系统版本:CentOS7.X在线YUM
# vi /etc/yum.repos.d/CentOS-Base.repo (编辑自带YUM配置文件
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
# yum clean all (清空缓存
# yum makecache (重建缓存
本地YUM
# mount /dev/sr0 /mnt (挂载镜像文件
# ll /mnt (查看镜像目录下有repodata数据库目录
drwxrwxr-x. 2 admin admin 4096 Dec 5 2016 repodata
# rm -rf /etc/yum.repos.d/* (清空YUM工具配置文件
# vi /etc/yum.repos.d/local.repo (创建本地配置文件
[local]
name=local #库名
baseurl=file:///mnt #库路径,指向存有repodata数据库目录的文件夹
gpgcheck=0 #安装时跳过签名检查/
enable=1 #开启此配置
# yum clean all (清空缓存
# yum makecache (重建缓存
以上是关于服务搭建第0步之YUM配置的主要内容,如果未能解决你的问题,请参考以下文章