当前位置: 首页 > 工具软件 > re-base > 使用案例 >

yum install 报错;Errors during downloading metadata for repository ‘c8-media-BaseOS‘

司空高义
2023-12-01
[root@localhost yum.repos.d]# yum makecache 
CentOS-8 - AppStream                                                                                 60 kB/s | 4.3 kB     00:00    
CentOS-8 - Base                                                                                      61 kB/s | 3.9 kB     00:00    
CentOS-8 - Epel                                                                                      86 kB/s | 4.7 kB     00:00    
CentOS-BaseOS-8 - Media                                                                             0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'c8-media-BaseOS':
  - Curl error (37): Couldn't read a file:// file for file:///media/CentOS/BaseOS/repodata/repomd.xml [Couldn't open file /media/CentOS/BaseOS/repodata/repomd.xml]
Error: Failed to download metadata for repo 'c8-media-BaseOS': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@localhost yum.repos.d]# yum install vim 
CentOS-BaseOS-8 - Media                                                                             0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'c8-media-BaseOS':
  - Curl error (37): Couldn't read a file:// file for file:///media/CentOS/BaseOS/repodata/repomd.xml [Couldn't open file /media/CentOS/BaseOS/repodata/repomd.xml]
Error: Failed to download metadata for repo 'c8-media-BaseOS': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

网络是通的ping百度没问题

查看yum源文件:

[root@localhost media]# cat /etc/yum.repos.d/base.repo 
[c8-media-BaseOS]
name=CentOS-BaseOS-$releasever - Media
baseurl=file:///media/CentOS/BaseOS/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[c8-media-AppStream]
name=CentOS-AppStream-$releasever - Media
baseurl=file:///media/CentOS/AppStream/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

挂载镜像:

 mount /dev/sr0 /media/CentOS/

 

 类似资料: