您现在的位置:首页 > 系统运维 > Linux运维

centos7 yum

错误现象: [root@localhost yum.repos.d]# yum makec…

错误现象:

[root@localhost yum.repos.d]# yum makecache 已加载插件:fastestmirror, langpacks Repository ‘centos7’: Error parsing config: Error parsing “baseurl = ‘file:///source/ # \xe6\x9c\xac\xe5\x9c\xb0YUM\xe7\x9b\xae\xe5\xbd\x95\xe7\xbb\x9d\xe5\xaf\xb9\xe8\xb7\xaf\xe5\xbe\x84′”: URL must be http, ftp, file or https not “” Loading mirror speeds from cached hostfile There are no enabled repos. Run “yum repolist all” to see the repos you have. To enable Red Hat Subscription Management repositories: subscription-manager repos –enable To enable custom repositories: yum-config-manager –enable [root@localhost yum.repos.d]#

clip_image013[4]

当前配置文件:

[root@localhost yum.repos.d]# cat yumsource.repo        
[centos7]
name=centos7
baseurl=file:///source/              #  本地YUM目录绝对路径
gpgcheck=0
enabled=1                            #  1表示启用,0表示关闭

[root@localhost yum.repos.d]# vim yumsource.repo

问题原因:repo配置文件中存在#的注释信息,删除即可。

清除缓存,重新建立yum索引信息。

[root@localhost yum.repos.d]# yum makecache      
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
centos7                                                                                               | 3.6 kB  00:00:00     
(1/4): centos7/group_gz                                                                                | 166 kB  00:00:00     
(2/4): centos7/primary_db                                                                              | 3.1 MB  00:00:00     
(3/4): centos7/other_db                                                                                | 1.3 MB  00:00:00     
(4/4): centos7/filelists_db                                                                            | 3.2 MB  00:00:00     

元数据缓存已建立
[root@localhost yum.repos.d]# yum list
[root@localhost yum.repos.d]# yum repolist all 
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
源标识                                                   源名称                                                  状态
centos7                                                    centos7                                                 启用: 4,021
repolist: 4,021

[root@localhost yum.repos.d]# yum repolist all 
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
源标识                                                   源名称                                                  状态
centos7                                                  centos7                                                 启用: 4,021
repolist: 4,021

yum正常的配置文件信息:

[root@localhost yum.repos.d]# cat yumsource.repo        
[centos7]
name=centos7
baseurl=file:///source/  
gpgcheck=0
enabled=1

版权所有
侵权必究

上一篇
Linux双网卡配置路由转发
下一篇
Centos 7安装FileRun记录与汉化