RHEL 5.7 Yum配置本地源[Errno 2] No such file or directory
来源:互联网 发布:sap hana数据库 编辑:程序博客网 时间:2024/05/17 07:43
在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.gz
3388/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 makecache
Loaded 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]#
作者:潇湘隐者
出处:http://www.cnblogs.com/kerrycode/
如果你真心觉得文章写得不错,而且对你有所帮助,那就不妨小小打赏一下吧,如果囊中羞涩,不妨帮忙“推荐"一下,您的“推荐”和”打赏“将是我最大的写作动力!
本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接.
0 0
- RHEL 5.7 Yum配置本地源[Errno 2] No such file or directory
- OSError: [Errno 2] No such file or directory
- OSError: [Errno 2] No such file or directory
- FileNotFoundError: [Errno 2] No such file or directory: 'template/
- IOError: [Errno 2] No such file or directory:
- python2.7:IOError: [Errno 2] No such file or directory:
- FileNotFoundError: [Errno 2] No such file or directory: 'tesseract'
- OSError: [Errno 2] No such file or directory
- IOError: [Errno 2] No such file or directory的解决方法
- Python webdriver 读取本地csv文件中数据 提示:IOError: [Errno 2] No such file or directory
- python: can't open file 'django-admin': [Errno 2] No such file or directory
- 出现这个 python: can't open file 'manage.py': [Errno 2] No such file or directory
- Android-4.4.2 编译出错 OSError: [Errno 2] No such file or directory
- Android-4.4.2 编译出错 OSError: [Errno 2] No such file or directory
- python使用urllib.urlretrieve时出现“IOError:[Errno 2] No such file or directory”解决办法
- Android 4.4 build err:OSError: [Errno 2] No such file or directory
- 使用Popen时报错:OSError: [Errno 2] No such file or directory
- Could not run curl-config: [Errno 2] No such file or directory
- HRBUST
- 斐波那契数列的四种简单实现方式
- Java OOP day03
- C# 分词算法,ChineseAnalyzer,源代码分析,其他地方的代码都是稀烂。。。。
- 蚂蚁感冒
- RHEL 5.7 Yum配置本地源[Errno 2] No such file or directory
- 海量数据处理问题之面试题
- ubuntu14.04搜狗输入法不能输入中文问题
- 设计模式(十五):原型模式
- Find the Duplicate Number
- hdu 2031 进制转换
- 申请人数大增美国大学录取条件看涨 备战雅思增强竞争力
- 第一次上机实验报告
- jmeter传参二:get与post请求参数传递方法