rhel5.x 光盘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]# 





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值