1、 将镜像挂载到虚拟机中
![]()
2、 挂载该镜像
[root@rui1 ~]# mount /dev/cdrom /media/
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@rui1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
18G 7.4G 9.1G 46% /
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 787M 0 787M 0% /dev/shm
/dev/mapper/vg1-lv1 5.0G 1.2G 3.6G 25% /u02
/dev/hdc 2.9G 2.9G 0 100% /media
[root@rui1 ~]#
3、 更改yum配置信息
[root@rui1 ~]# cd /etc/yum.repos.d/
[root@rui1 yum.repos.d]# ls
rhel-debuginfo.repo
[root@rui1 yum.repos.d]# cp rhel-debuginfo.repo yum.repo
[root@rui1 yum.repos.d]# ls
rhel-debuginfo.repo yum.repo
[root@rui1 yum.repos.d]# vi yum.repo
[SERVER]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///media/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
4、 测试是否安装成功
[root@rui1 yum.repos.d]# yum install -y vnc*
Loaded plugins: rhnplugin, security
Repository rhel-debuginfo-beta is listed more than once in the configuration
This system is not registered with RHN.
RHN support will be disabled.
SERVER | 1.3 kB 00:00
SERVER/primary | 753 kB 00:00
SERVER 2348/2348
Setting up Install Process
Package vnc-server-4.1.2-14.el5_3.1.i386 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package vnc.i386 0:4.1.2-14.el5_3.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
vnc i386 4.1.2-14.el5_3.1 SERVER 159 k
Transaction Summary
================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 159 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : vnc 1/1
Installed:
vnc.i386 0:4.1.2-14.el5_3.1
Complete!
[root@rui1 yum.repos.d]#
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29802484/viewspace-1416510/ ,如需转载,请注明出处,否则将追究法律责任。