一、创建本地yum源
1. 挂载CD: mount /dev/cdrom /mnt
2. 编辑yum源文件:vim /etc/yum.repos.d/rhel-debuginfo.repo
[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///mnt/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
---------------------------------------------------------------------------------
enabled值改为1,gpgcheck值改为0.
3. 清除原yum列表:yum clean all
4. 更新yum列表:yum list
二、创建ISO镜你yum源
只需要将/etc/yum.repos.d/下面的*.repo文件复制,并放在创建好的bak文件夹下,然后创建自己的.repo文件,如以下配置
[base]
name=RedHat
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
enabled=1
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
浏览器可以访问网址:http://mirrors.163.com/centos
后面的安装你需要的Centos的版本来配置。