码迷,mamicode.com
首页 > 其他好文 > 详细

yum 报错 [Errno 14] Could not open/read file:///media/iso/repodata/repomd.xml

时间:2020-03-17 12:39:23      阅读:112      评论:0      收藏:0      [点我收藏+]

标签:may   image   and   mic   nali   conf   fun   mamicode   dia   

yum执行安装命令报错  

技术图片

 

 1.yum安装时,需要确定安装源,安装源的配置在/etc/yum.repos.d/中,每个源对应一个文件(以.repo为后缀),如果只配置了本地源,而此时安装光盘(即ISO文件)没有挂载的话自然无法找到安装文件

此时要么挂载ISO至指定目录,要目就配置新的网络安装源

2.新建网络安装源配置,名字CentOS-Base.repo

 

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates 
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

3.执行命令

yum clean all
yum makecache

4 如果出现

   [Errno 14] PYCURL ERROR 6 - "Couldn‘t resolve host ‘ftp.sjtu.edu.cn‘"

   修改 /etc/resolv.conf
   添加一个nameserver 8.8.8.8完成

 技术图片

 

 

yum 报错 [Errno 14] Could not open/read file:///media/iso/repodata/repomd.xml

标签:may   image   and   mic   nali   conf   fun   mamicode   dia   

原文地址:https://www.cnblogs.com/canger/p/12509847.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!