yun配置文件
[ambari]
name=local iso
baseurl=file:///home/redhat-iso/ #填写挂载镜像的位置
enable=1
gpgcheck=1 #gpg签名校验 默认关闭
gpgkey=file:///home/redhat-iso/RPM-GPG-KEY-CentOS-6 #该处的gpgkey文件应该改成iso镜像中的文件名
报错
已加载插件:fastestmirror
Repository ‘centos7-media’: Error parsing config: Error parsing “gpgkey = ‘file://media/cdrom/RPM-GPG-KEY-CentOS-7 #GPG-KEY\xe6\x96\x87\xe4\xbb\xb6\xe8\xb7\xaf\xe5\xbe\x84’”: URL must be http, ftp, file or https not “”
原因:是因为配置文件中有注释,把注释去掉就好了
阿里云源下载命令
wget http://mirrors.aliyun.com/repo/Centos-7.repo
结束需要clean all and makecache
[root@centos7-web ~]# yum clean all
[root@centos7-web ~]# yum makecache