由于rhel没有注册码,之前一直用DVD做更新源,但是rhel又不能从官网上更新,怎么办呢,想想就使用CentOS的更新源吧:
首先把rhel自带的文件备份:
[root@test yum.repos.d]# cp rhel-debuginfo.repo rhel-debuginfo.repo.bak
[root@test yum.repos.d]# mv rhel-debuginfo.repo CentOS-Base.repo
[root@test yum.repos.d]# vi CentOS-Base.repo
[base]
name=CentOS-5-Base
repo=os
baseurl=http://centos.ustc.edu.cn/centos/5/os/$basearch/
gpgcheck=0
gpgkey=http://centos.ustuc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[updates]
name=CentOS-5-Updates
baseurl=http://centos.ustc.edu.cn/centos/5/updates/$basearch/
gpgcheck=0
gpgkey=http://centos.ustuc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[addons]
name=CentOS-5-Addons
baseurl=http://centos.ustc.edu.cn/centos/5/addons/$basearch/
gpgcheck=0
gpgkey=http://centos.ustuc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[extras]
name=CentOS-5-Extras
baseurl=http://centos.ustc.edu.cn/centos/5/extras/$basearch/
gpgcheck=0
gpgkey=http://centos.ustuc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[centosplus]
name=CentOS-5-Plus
baseurl=http://centos.ustc.edu.cn/centos/5/centosplus/$basearch/
gpgcheck=0
gpgkey=http://centos.ustuc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[contrib]
name=CentOS-5-Contrib
baseurl=http://centos.ustc.edu.cn/centos/5/contrib/$basearch/
gpgcheck=0
gpgkey=http://centos.ustuc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[root@test yum.repos.d]# rpm --import /etc/pki/rpm-gpg/RPM*
把虚拟机联网然后测试一下
[root@test yum.repos.d]# yum list
[root@test yum.repos.d]# yum install mysql
Loaded plugins: aliases, changelog, downloadonly, fastestmirror, filter-data, keys, kmod, list-data, protect-packages, protectbase, rhnplugin, security, tmprepo,
: verify, versionlock
This system is not registered with RHN.
RHN support will be disabled.
Loading mirror speeds from cached hostfile
addons | 1.9 kB 00:00
base | 1.1 kB 00:00
centosplus | 1.9 kB 00:00
contrib | 1.9 kB 00:00
extras | 2.1 kB 00:00
updates | 1.9 kB 00:00
Skipping filters plugin, no data
0 packages excluded due to repository protections
Reading version lock configuration
Setting up Install Process
Resolving Dependencies
Skipping filters plugin, no data
--> Running transaction check
---> Package mysql.i386 0:5.0.95-1.el5_7.1 set to be updated
--> Processing Dependency: perl(DBI) for package: mysql
--> Running transaction check
---> Package perl-DBI.i386 0:1.52-2.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved