RHEL 5.7 Yum配置本地源[Errno 2] No such file or directory
在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]#
RHEL 5.7 Yum配置本地源[Errno 2] No such file or directory的更多相关文章
- centos 系统软件包管理 yum 本地yum配置 扩展源epel rpm 清除yum缓存 yum provides "*/vim" 第十节课
centos 系统软件包管理 yum 本地yum配置 扩展源epel rpm 清除yum缓存 yum provides "*/vim" 第十节课 你不能保证可逆化操 ...
- Ubuntu 配置本地源
Ubuntu 配置本地源 操作系统 Ubuntu 20.04.2 LTS 一.挂载 iso 到本地 mount -t iso9660 -o loop /dev/sr0 /media/cdrom //- ...
- Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt
最近安装python,已经安装好,cmd终端中输入python.pip等命令都有用 然而在配置requirements.txt文件过程中,执行语句 “pip install -r requiremen ...
- FileNotFoundError: [Errno 2] No such file or directory: 'image/1.jpg'问题解决
FileNotFoundError: [Errno 2] No such file or directory: 'image/1.jpg'问题 最近在学习爬虫,想爬一些图片并保存到本地,但是在下载图片 ...
- VSCode python 遇到的问题:vscode can't open file '<unprintable file name>': [Errno 2] No such file or directory
代码很简单,就两行: import pandas as pd import netCDF4 as nc dataset = nc.Dataset('20150101.nc') 环境:在VSCode中左 ...
- can't open file 'manage.py': [Errno 2] No such file or directory
python Django创建数据库时can't open file 'manage.py': [Errno 2] No such file or directory 参考https://blog.c ...
- ansible执行shell模块和command模块报错| FAILED | rc=127 >> /bin/sh: lsof: command not found和| rc=2 >> [Errno 2] No such file or directory
命令: ansible -i hosts_20 st -m shell -a 'service zabbix_agentd star' -K --become ansible -i hosts_2 ...
- [Errno 2] No such file or directory
Centos7.5 执行ansible命令报错 问题: [root@m01 ~]# ansible servers -a "hostname|grep web" -i ./host ...
- 关于python中的 “ FileNotFoundError: [Errno 2] No such file or directory: '……'问题 ”
今天在学python时,在模仿一个为图片加上图标并移动到指定文件夹的程序时遇到“FileNotFoundError: [Errno 2] No such file or directory: '152 ...
随机推荐
- C/C++,彩色图像小游戏。
这里声明,这个游戏是由本人,在大一暑假自作的第二个小游戏,转载请注明原帖地址,谢谢! 所有图片都是我一个人用ps搞出来的,比较简单.........毕竟不是学图像制作的,请体谅!另外,图片 不放出来了 ...
- Cesium应用篇:3控件(3)SelectionIndicator& InfoBox
假设这样一个场景,用户在Cesium球上加载了一个GeoJson文件(DataSource),里面是全美国所有州的Geometry信息(Entity),叠加到球面后,你自然会有一种冲动,点击某一个州, ...
- DotNet程序集解析
在.NET Framework框架中,程序集是重用.安全性以及版本控制的最小单元.程序集的定义为:程序集是一个或多个类型定义文件及资源文件的集合.程序集主要包含:PE/COFF,CLR头,元数据,清单 ...
- 关于引用PagerSlidingTabStrip无法引用的问题
本人仅仅是在安卓学习阶段,在做左右滑动时,用ViewPager总是有各种各样的问题. 如今在github上已经有了这个开源项目PagerSlidingTabStrip,和ViewPager结合在一起会 ...
- C#图片存入数据库及其读出显示
<1>将图片转换成二进制插入数据库 FileStream fs = new FileStream("D:\\Add.ico",FileMode.Open); byte[ ...
- 【集合框架】JDK1.8源码分析之Collections && Arrays(十)
一.前言 整个集合框架的常用类我们已经分析完成了,但是还有两个工具类我们还没有进行分析.可以说,这两个工具类对于我们操作集合时相当有用,下面进行分析. 二.Collections源码分析 2.1 类的 ...
- OpenGL超级宝典visual studio 2013开发环境配置,GLTools
做三维重建需要用到OpenGL,开始看<OpenGL超级宝典>,新手第一步配置环境就折腾了一天,记录下环境的配置过程. <超级宝典>中的例子使用了GLEW,freeglut以及 ...
- AngularJS中的方法参数的问题
在使用AngularJS开发的过程中出现了如下的问题,一次贴记录下. 感觉也不能说是AngularJS的语法,应该说是JS里面的处理流程应该就是这样子,我现在想通过前端页面传递值到后端(通过方法传递) ...
- 【吐槽】gist.github.com疑遭中间人攻击
北京时间201510081004,云南电信用户,现在上https://gist.github.com/,用IE10会提示证书被伪造,用搜狗4.1.3.9668会跳转到[http://www.cjb.n ...
- onclick标签变成小手状
style=“cursor: pointer;”