1、准备linux ISO系统镜像文件 (例如:rhel-server-5.5-i386-dvd.iso)
2、linux虚拟机(centos 7 192.168.50.24 ),启动sshd服务 systemctl start httpd.service
3、放置rhel-server-5.5-i386-dvd.iso到虚拟机 /dir 中
4、在 /var/www/html 目录下创建文件夹 redhat5.5
5、运行命令 mount -o loop /dir/rhel-server-5.5-i386-dvd.iso /var/www/html/redhat5.5/
通过网页访问 http://192.168.50.24/redhat5.5/ 看查看到系统目录
客户端本地设置
在/etc/yum.repos.d/ 目录中 修改文件rhel-source.repo(不存在可直接添加)
添加内容
[rhel-source]
name=Red Hat Enterprise Linux $releasever - Source
baseurl=http://192.168.50.24/redhat5.5/Server
enabled=1
gpgcheck=1
gpgcheck=1
gpgkey=
运行命令: service yum-updatesd restart
例:
Loaded plugins: rhnplugin, security This system is not registered with RHN. RHN support will be disabled. rhel-source | 1.3 kB 00:00 rhel-source/primary | 777 kB 00:00 rhel-source 2428/2428 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package gcc.i386 0:4.1.2-50.el5 set to be updated --> Processing Dependency: cpp = 4.1.2-50.el5 for package: gcc --> Processing Dependency: libgcc >= 4.1.2-50.el5 for package: gcc --> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc --> Processing Dependency: libgomp >= 4.1.2-50.el5 for package: gcc --> Running transaction check ---> Package cpp.i386 0:4.1.2-50.el5 set to be updated ---> Package glibc-devel.i386 0:2.5-58 set to be updated --> Processing Dependency: glibc = 2.5-58 for package: glibc-devel --> Processing Dependency: glibc-headers = 2.5-58 for package: glibc-devel --> Processing Dependency: glibc-headers for package: glibc-devel ---> Package libgcc.i386 0:4.1.2-50.el5 set to be updated ---> Package libgomp.i386 0:4.4.4-13.el5 set to be updated --> Running transaction check --> Processing Dependency: glibc = 2.5-49 for package: nscd ---> Package glibc.i686 0:2.5-58 set to be updated --> Processing Dependency: glibc-common = 2.5-58 for package: glibc ---> Package glibc-headers.i386 0:2.5-58 set to be updated --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers --> Processing Dependency: kernel-headers for package: glibc-headers --> Running transaction check ---> Package glibc-common.i386 0:2.5-58 set to be updated ---> Package kernel-headers.i386 0:2.6.18-238.el5 set to be updated ---> Package nscd.i386 0:2.5-58 set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================================================================================= Package Arch Version Repository Size ============================================================================================================================================================================================================================================= Installing: gcc i386 4.1.2-50.el5 rhel-source 5.2 M Installing for dependencies: cpp i386 4.1.2-50.el5 rhel-source 2.7 M glibc-devel i386 2.5-58 rhel-source 2.0 M glibc-headers i386 2.5-58 rhel-source 603 k kernel-headers i386 2.6.18-238.el5 rhel-source 1.1 M libgomp i386 4.4.4-13.el5 rhel-source 72 k Updating for dependencies: glibc i686 2.5-58 rhel-source 5.3 M glibc-common i386 2.5-58 rhel-source 16 M libgcc i386 4.1.2-50.el5 rhel-source 96 k nscd i386 2.5-58 rhel-source 166 k Transaction Summary ============================================================================================================================================================================================================================================= Install 6 Package(s) Upgrade 4 Package(s) Total download size: 34 M Is this ok [y/N]: y Downloading Packages: (1/10): glibc-headers-2.5-58.i386.rpm | 603 kB 00:00 (2/10): libgcc-4.1.2-50.el5.i386.rpm | 96 kB 00:00 (3/10): glibc-devel-2.5-58.i386.rpm | 2.0 MB 00:00 (4/10): nscd-2.5-58.i386.rpm | 166 kB 00:00 (5/10): glibc-common-2.5-58.i386.rpm | 16 MB 00:11 (6/10): glibc-2.5-58.i686.rpm | 5.3 MB 00:01 (7/10): cpp-4.1.2-50.el5.i386.rpm | 2.7 MB 00:00 (8/10): libgomp-4.4.4-13.el5.i386.rpm | 72 kB 00:00 (9/10): kernel-headers-2.6.18-238.el5.i386.rpm | 1.1 MB 00:00 (10/10): gcc-4.1.2-50.el5.i386.rpm | 5.2 MB 00:01 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 2.0 MB/s | 34 MB 00:16 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 37017186 Public key for glibc-headers-2.5-58.i386.rpm is not installed
导入rpm的签名信息即可
以root登录,执行下面命令 # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release