公司服务器是RHEL4,所以下了个CentOS4的镜像,装上虚拟机发现有两个问题:
1. 安装时崩溃:VirtualBox添加虚拟机时不使用SATA硬盘,改为IDE硬盘,估计那个时候还没有SATA。
2. yum无效,因为RHEL4已经不维护了,所以需要将yum的源改为本地,但是改过之后还是不行,有两点要注意:
第一点,操作步骤:
[ @localhost ~]$ cd /etc/yum.repos.d/
[ @localhost yum.repos.d]$ sudo mv CentOS-Base.repo CentOS-Base.repo.bk
[ @localhost yum.repos.d]$ sudo cp CentOS-Media.repo winlin.cdrom.repo
[ @localhost yum.repos.d]$ sudo vi winlin.cdrom.repo
将内容改为:
[c4-media]
name=CentOS-$releasever - Media
baseurl=file:///media/mnt/
gpgcheck=1
enabled=1
gpgkey=file:///usr/share/doc/centos-release-4/RPM-GPG-KEY-centos4
然后执行命令:
[ @localhost yum.repos.d]$ sudo mkdir -p /media/mnt
[ @localhost yum.repos.d]$ sudo mount /dev/cdrom /media/mnt/
最后更新yum:
[ @localhost yum.repos.d]$ sudo yum clean all
Cleaning up Everything
0 headers removed
0 packages removed
3 metadata files removed
0 cache files removed
1 cache files removed
[ @localhost yum.repos.d]$ sudo yum list
Setting up repositories
c4-media 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 611 kB 00:00
c4-media : ################################################## 1599/1599