centos 5 6安装本地yum源
来源:互联网 发布:淘宝天下网商 编辑:程序博客网 时间:2024/05/17 08:05
5.7 6.5 试用:
mkdir /opt/mnt
mount /dev/cdrom /opt/mnt
配置如下 文件:
备份一下原来文件
cp /etc/yum.redo.d/**.repo /etc/yum.redo.d/**.repo.bak
vim /etc/yum.redo.d/**.repo
添加:
如下既可
在Red Hat Enterprise Linux Server release 5.7 上配置YUM本地源时,
遇到了"Errno 5] OSError: [Errno 2] No such file or directory xxxx",花了点时间搞清楚错误的来龙去脉。特此记录一下:
遇到了"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
[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 allLoaded plugins: product-id, security, subscription-managerUpdating Red Hat repositories.Cleaning up Everything[root@DB-Server yum.repos.d]# yum makecacheLoaded plugins: product-id, security, subscription-managerUpdating 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 baseurl=file:///mnt/cdrom/LinuxSrc/Server
enabled=1
gpgcheck=0
gpgkey=file:///mnt/cdrom/LinuxSrc/RPM-GPG-KEY-redhat-release
[media]
name=Red Hat Enterprise Linux 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 37017186Preparing... ########################################### [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
mmSaving Primary metadataSaving file lists metadataSaving other metadataYou have new mail in /var/spool/mail/root
[root@DB-Server Server]# yum makecache
Loaded plugins: product-id, security, subscription-managerUpdating 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/3388media 3388/3388media 3388/3388Metadata Cache Created
warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186Preparing... ########################################### [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
mmSaving Primary metadataSaving file lists metadataSaving other metadataYou have new mail in /var/spool/mail/root
[root@DB-Server Server]# yum makecache
Loaded plugins: product-id, security, subscription-managerUpdating 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/3388media 3388/3388media 3388/3388Metadata Cache Created
0 0
- centos 5 6安装本地yum源
- CentOS 6.5使用本地yum源安装
- CentOS本地yum源
- CentOS---本地yum源
- 为CentOS 6 配置本地YUM源
- 为CentOS 6 配置本地YUM源
- 为CentOS 6 配置本地YUM源
- 为CentOS 6 配置本地YUM源
- CentOS 6 安装yum 源
- Yum离线安装(三) --- 制作 CentOS 本地软件源
- 安装CDH5-CENTOS 6.5搭建本地YUM源
- centos镜像作为本地源的yum安装
- CentOS创建本地yum源
- CentOS配置本地YUM源
- CentOS建立本地yum源
- centos 配置本地yum源
- centos 配置本地yum源
- CentOS设置yum本地源
- WMI的Win32_NetworkAdapterConfiguration
- Linux 搭建Hadoop集群执行命令start-dfs.sh报错 permission denied
- 正则表达式:只保留字符串中的汉字和字母
- 【English 】 Follow Paul
- 面试题(二)
- centos 5 6安装本地yum源
- 一个R语言使用函数处理的基本的案例
- PHP 底层的运行机制与原理
- 会声会影X9破解版 含注册机和注册码
- Android proguard 详解
- Android源码解析系列
- POJ1190===搜索+剪枝===生日蛋糕
- 【Linux】IFS是个什么鬼
- CABasicAnimation用法