帝王谷资源网 Design By www.wdxyy.com
在Red Hat Enterprise Linux Server release 5.7 上配置YUM本地源时,遇到了"[Errno 5] OSError: [Errno 2] No such file or directory xxxx",花了点时间搞清楚错误的来龙去脉。特此记录一下:
将Redhat 5.7的光盘镜像拷贝到了/mnt/cdrom/LinuxSrc目录下,配置了rhel-media.repo文件,如下所示
复制代码代码如下:
[root@DB-Server yum.repos.d]# more rhel-media.repo
[media]
name=Red Hat Enterprise Linux 5.7 baseurl=file:///mnt/cdrom/LinuxSrc
enabled=1
gpgcheck=0 gpgkey=file:///mnt/cdrom/LinuxSrc/RPM-GPG-KEY-redhat-release
执行yum clean all命令后,执行yum makecache遇到了下面错误:
复制代码代码如下:
[root@DB-Server yum.repos.d]# yum clean all
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Cleaning up Everything
[root@DB-Server yum.repos.d]# yum makecache
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
file:///mnt/cdrom/LinuxSrc/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/mnt/cdrom/LinuxSrc/repodata/repomd.xml'
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: media. Please verify its path and try again
[root@DB-Server yum.repos.d]#
出现这个错误的根本原因在于RHEL 5.x 版本与RHEL 6.x 版本的rpm包存放路径不同:
RHEL 5.x : ../Server 例如:我案例环境位于/mnt/cdrom/LinuxSrc/Server 下。
RHEL 6.x : ../Packages
所以还在于上面的baseurl参数设置错误。那么我们可以通过两种方法解决这个问题:
方法1:配置正确的baseurl参数。
复制代码代码如下:
[root@DB-Server yum.repos.d]# vi rhel-media.repo
[media]
name=Red Hat Enterprise Linux 5.7 baseurl=file:///mnt/cdrom/LinuxSrc/Server
enabled=1
gpgcheck=0
gpgkey=file:///mnt/cdrom/LinuxSrc/RPM-GPG-KEY-redhat-release
方法2:使用createrepo命令创建本地源目录,将其指向baseurl指定的目录
复制代码代码如下:
[root@DB-Server Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:createrepo ########################################### [100%]
[root@DB-Server Server]# createrepo --update /mnt/cdrom/LinuxSrc
Previous repo file missing: /mnt/cdrom/LinuxSrc/repodata/primary.xml.gz3388/3388 - VT/etherboot-roms-5.4.4-15.el5.x86_64.rpm mm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
You have new mail in /var/spool/mail/root
[root@DB-Server Server]# yum makecacheLoaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
media | 951 B 00:00
media/filelists | 3.1 MB 00:00
media/other | 11 MB 00:00
media/primary | 1.1 MB 00:00
media 3388/3388
media 3388/3388
media 3388/3388
Metadata Cache Created[root@DB-Server Server]#
将Redhat 5.7的光盘镜像拷贝到了/mnt/cdrom/LinuxSrc目录下,配置了rhel-media.repo文件,如下所示
复制代码代码如下:
[root@DB-Server yum.repos.d]# more rhel-media.repo
[media]
name=Red Hat Enterprise Linux 5.7 baseurl=file:///mnt/cdrom/LinuxSrc
enabled=1
gpgcheck=0 gpgkey=file:///mnt/cdrom/LinuxSrc/RPM-GPG-KEY-redhat-release
执行yum clean all命令后,执行yum makecache遇到了下面错误:
复制代码代码如下:
[root@DB-Server yum.repos.d]# yum clean all
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Cleaning up Everything
[root@DB-Server yum.repos.d]# yum makecache
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
file:///mnt/cdrom/LinuxSrc/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/mnt/cdrom/LinuxSrc/repodata/repomd.xml'
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: media. Please verify its path and try again
[root@DB-Server yum.repos.d]#
出现这个错误的根本原因在于RHEL 5.x 版本与RHEL 6.x 版本的rpm包存放路径不同:
RHEL 5.x : ../Server 例如:我案例环境位于/mnt/cdrom/LinuxSrc/Server 下。
RHEL 6.x : ../Packages
所以还在于上面的baseurl参数设置错误。那么我们可以通过两种方法解决这个问题:
方法1:配置正确的baseurl参数。
复制代码代码如下:
[root@DB-Server yum.repos.d]# vi rhel-media.repo
[media]
name=Red Hat Enterprise Linux 5.7 baseurl=file:///mnt/cdrom/LinuxSrc/Server
enabled=1
gpgcheck=0
gpgkey=file:///mnt/cdrom/LinuxSrc/RPM-GPG-KEY-redhat-release
方法2:使用createrepo命令创建本地源目录,将其指向baseurl指定的目录
复制代码代码如下:
[root@DB-Server Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:createrepo ########################################### [100%]
[root@DB-Server Server]# createrepo --update /mnt/cdrom/LinuxSrc
Previous repo file missing: /mnt/cdrom/LinuxSrc/repodata/primary.xml.gz3388/3388 - VT/etherboot-roms-5.4.4-15.el5.x86_64.rpm mm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
You have new mail in /var/spool/mail/root
[root@DB-Server Server]# yum makecacheLoaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
media | 951 B 00:00
media/filelists | 3.1 MB 00:00
media/other | 11 MB 00:00
media/primary | 1.1 MB 00:00
media 3388/3388
media 3388/3388
media 3388/3388
Metadata Cache Created[root@DB-Server Server]#
标签:
RedHat,错误,yum
帝王谷资源网 Design By www.wdxyy.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
帝王谷资源网 Design By www.wdxyy.com
暂无评论...
更新日志
2024年10月28日
2024年10月28日
- 群星2013-青春缤纷辑压箱宝大公开3CD2[新加坡限量版][WAV整轨]
- 林育群.2013-BalladShow(日本版)【环球】【WAV+CUE】
- 陈加洛.1992-痛到感觉不到【宝丽金】【WAV+CUE】
- 群星.2023-宿命之敌电视剧原声带【韶愔音乐】【FLAC分轨】
- 東京事変-大発見[FLAC+CUE]
- 椎名林檎-三文ゴシップ[FLAC+CUE]
- 2024年08月04日
- 裘德《裘德「最后的水族馆」演唱会LIVE》[320K/MP3][228.89MB]
- 裘德《裘德「最后的水族馆」演唱会LIVE》[24bit 48kHz][FLAC/分轨][2.08G]
- 基因三重奏《如果你什么都不说 音乐会现场录音》[320K/MP3][145.37MB]
- 孟庭苇.1996-月亮说话(2020环球24KGOLD限量版)【上华】【WAV+CUE】
- 群星.1997-新艺宝优质音响系列·国语精选监听版【新艺宝】【WAV+CUE】
- 阿桑.2005-寂寞在唱歌(星外星引进版)【华研国际】【WAV+CUE】
- 基因三重奏《如果你什么都不说 音乐会现场录音》[FLAC/分轨][287.43MB]
- 蔡题谦《我爱你,却依然要看你走》[320K/MP3][88.65MB]