redhat 6及centos5.6加载光驱并设置更新源yum

1\CentOS5.6使用光驱+系统光盘做源其实很简单,因为操作系统里面的配置文件已经写好了,剩下的我们只有根据所写的挂载正确就行,用光驱做源的配置文件已经被写在/etc/yum.repos.d/CentOS-Media.repo,里面的光驱路径是baseurl=file:///media/CentOS,所以操作步骤如下:

(1)建立文件夹mkdir -p /media/cdrom;

(2)挂载光驱mount /dev/cdrom /media/cdrom;

(3)使用命令安装rpm包:

yum --disablerepo=\* --enablerepo=c5-media -y install mysql mysql-server gmp;

yum --disablerepo=\* --enablerepo=c5-media  -y install net-snmp net-snmp-utils libg* liberation-fonts;





2\redhat6配置光盘为yum源:

mount /dev/cdrom /mnt

编辑yum.repo.d下的相关文件

baseurl=file:///mnt
enabled=1
gpgcheck=0


然后清空相关的配置:yum clean all

测试安装httpd:yum  install httpd


3\配置ftp服务器为yum更新源

部署好ftp服务器,可以匿名访问:ftp://192.168.0.110/pub/redhat6.2

把系统盘的文件全部拷贝到这个ftp目前:/var/ftp/pub/redhat6.2

设置更新源文件:vim /etc/yum.repos.d/abc.repo

[abc]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
#baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
baseurl=ftp://192.168.0.110/pub/redhat6.2
enabled=1
gpgcheck=0

设置好后,运行yum clean all

不用管那个gpgkey

你可能感兴趣的:(redhat)