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

rhel5.x 光盘yum源配置

时间:2014-12-25 18:20:06      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:rhel5.x   cdrom   yum   


[root@vmb ~]# mkdir -p /mnt/cdrom
[root@vmb ~]# mount /dev/cdrom /mnt/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@vmb ~]# 
[root@vmb ~]# 
[root@vmb ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol01
                       18G  4.8G   12G  30% /
/dev/sda1             190M   13M  168M   8% /boot
tmpfs                 500M     0  500M   0% /dev/shm
/dev/hdc              4.1G  4.1G     0 100% /mnt/cdrom

[root@vmb ~]# cd /etc/yum.repos.d/
[root@vmb yum.repos.d]# ll
total 8
-rw-r--r-- 1 root root 254 Nov 13  2012 rhel-debuginfo.repo

原来:
[root@vmb yum.repos.d]# cat rhel-debuginfo.repo_back 
[rhel-debuginfo] 
name=Red Hat Enterprise Linux $releasever - $basearch - Debug 
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/ 
enabled=0 
gpgcheck=1 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 


修改后:
[root@vmb yum.repos.d]# cat rhel-debuginfo.repo 
[rhel-debuginfo] 
name=Red Hat Enterprise Linux $releasever - $basearch - Debug 
baseurl=file:///mnt/cdrom/Server--------------------------> 此处有变化
enabled=1 --------------------------> 此处有变化</span>
gpgcheck=1 
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release

执行如下:
[root@rhel59 yum.repos.d]# yum clean all
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning up Everything

测试yum源的效果:
[root@rhel59 yum.repos.d]# yum list | grep gcc
compat-libgcc-296.i386                  2.96-138                  installed     
libgcc.i386                             4.1.2-54.el5              installed     
libgcc.x86_64                           4.1.2-54.el5              installed     
compat-gcc-34.x86_64                    3.4.6-4.1                 rhel-debuginfo
compat-gcc-34-c++.x86_64                3.4.6-4.1                 rhel-debuginfo
compat-gcc-34-g77.x86_64                3.4.6-4.1                 rhel-debuginfo
gcc.x86_64                              4.1.2-54.el5              rhel-debuginfo
gcc-c++.x86_64                          4.1.2-54.el5              rhel-debuginfo
gcc-gfortran.x86_64                     4.1.2-54.el5              rhel-debuginfo
gcc-gnat.x86_64                         4.1.2-54.el5              rhel-debuginfo
gcc-java.x86_64                         4.1.2-54.el5              rhel-debuginfo
gcc-objc.x86_64                         4.1.2-54.el5              rhel-debuginfo
gcc-objc++.x86_64                       4.1.2-54.el5              rhel-debuginfo
gcc44.x86_64                            4.4.7-1.el5               rhel-debuginfo
gcc44-c++.x86_64                        4.4.7-1.el5               rhel-debuginfo
gcc44-gfortran.x86_64                   4.4.7-1.el5               rhel-debuginfo
[root@vmb yum.repos.d]# 




技术分享





rhel5.x 光盘yum源配置

标签:rhel5.x   cdrom   yum   

原文地址:http://blog.csdn.net/msdnchina/article/details/42149745

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