[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]#