挂载ISO文件:
mkdir -p /media/rhel
mount -o loop rhel.iso /media/rhel
添加文件rhel.repo到/etc/yum.repos.d/下,在rhel.repo中加入如下内容
[rhel_6_iso]
name=local isobaseurl=file:///media/rhel/
gpgcheck=1gpgkey=file:///media/rhel/RPM-GPG-KEY-redhat-release测试安装kvm
yun install kvm
[root@localhost rhel]# yum install kvm
Loaded plugins: fastestmirror, product-id, subscription-manager
Updating certificate-based repositories.
Loading mirror speeds from cached hostfile
addons | 1.9 kB 00:00
base | 1.1 kB 00:00
extras | 1.9 kB 00:00
rhel_6_iso | 4.0 kB 00:00 ...
rhel_6_iso/primary_db | 3.1 MB 00:00 ...
update | 1.9 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package qemu-kvm.x86_64 2:0.12.1.2-2.209.el6 will be installed
rhel_6_iso/filelists_db | 3.6 MB 00:00 ...
--> Processing Dependency: qemu-img = 2:0.12.1.2-2.209.el6 for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: vgabios-vmware for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: vgabios-stdvga for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: vgabios-qxl for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: vgabios for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: seabios for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: libspice-server.so.1(SPICE_SERVER_0.8.3)(64bit) for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: libspice-server.so.1(SPICE_SERVER_0.8.2)(64bit) for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: libspice-server.so.1(SPICE_SERVER_0.8.1)(64bit) for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: libspice-server.so.1(SPICE_SERVER_0.6.0)(64bit) for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: /usr/share/sgabios/sgabios.bin for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: /usr/share/gpxe/virtio-net.rom for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: /usr/share/gpxe/rtl8139.rom for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: /usr/share/gpxe/rtl8029.rom for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: /usr/share/gpxe/pcnet32.rom for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: /usr/share/gpxe/e1000-0x100e.rom for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: libspice-server.so.1()(64bit) for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Processing Dependency: libcelt051.so.0()(64bit) for package: 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64
--> Running transaction check
---> Package celt051.x86_64 0:0.5.1.3-0.el6 will be installed
---> Package gpxe-roms-qemu.noarch 0:0.9.7-6.9.el6 will be installed
---> Package qemu-img.x86_64 2:0.12.1.2-2.209.el6 will be installed
---> Package seabios.x86_64 0:0.6.1.2-8.el6 will be installed
---> Package sgabios-bin.noarch 0:0-0.3.20110621svn.el6 will be installed
---> Package spice-server.x86_64 0:0.8.2-5.el6 will be installed
---> Package vgabios.noarch 0:0.6b-3.6.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================
Package Arch Version Repository Size
=========================================================================================================
Installing:
qemu-kvm x86_64 2:0.12.1.2-2.209.el6 rhel_6_iso 1.1 M
Installing for dependencies:
celt051 x86_64 0.5.1.3-0.el6 rhel_6_iso 50 k
gpxe-roms-qemu noarch 0.9.7-6.9.el6 rhel_6_iso 219 k
qemu-img x86_64 2:0.12.1.2-2.209.el6 rhel_6_iso 329 k
seabios x86_64 0.6.1.2-8.el6 rhel_6_iso 83 k
sgabios-bin noarch 0-0.3.20110621svn.el6 rhel_6_iso 6.6 k
spice-server x86_64 0.8.2-5.el6 rhel_6_iso 251 k
vgabios noarch 0.6b-3.6.el6 rhel_6_iso 42 k
Transaction Summary
=========================================================================================================
Install 8 Package(s)
Total download size: 2.1 M
Installed size: 6.1 M
Is this ok [y/N]: y
Downloading Packages:
---------------------------------------------------------------------------------------------------------
Total 26 MB/s | 2.1 MB 00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Retrieving key from file:///media/rhel/RPM-GPG-KEY-redhat-release
Importing GPG key 0xFD431D51:
Userid: "Red Hat, Inc. (release key 2) <security@redhat.com>"
From : /media/rhel/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Importing GPG key 0x2FA658E0:
Userid: "Red Hat, Inc. (auxiliary key) <security@redhat.com>"
From : /media/rhel/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
PackageKit-0.5.8-19.el6.x86_64 has missing requires of PackageKit-yum = ('0', '0.5.8', '19.el6')
PackageKit-0.5.8-19.el6.x86_64 has missing requires of PackageKit-yum-plugin = ('0', '0.5.8', '19.el6')
rhn-check-1.0.0-73.el6.noarch has missing requires of yum-rhn-plugin >= ('0', '0.9.1', '35')
Installing : celt051-0.5.1.3-0.el6.x86_64 1/8
Installing : spice-server-0.8.2-5.el6.x86_64 2/8
Installing : seabios-0.6.1.2-8.el6.x86_64 3/8
Installing : sgabios-bin-0-0.3.20110621svn.el6.noarch 4/8
Installing : vgabios-0.6b-3.6.el6.noarch 5/8
Installing : 2:qemu-img-0.12.1.2-2.209.el6.x86_64 6/8
Installing : gpxe-roms-qemu-0.9.7-6.9.el6.noarch 7/8
Installing : 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 8/8
rhel_6_iso/productid | 1.7 kB 00:00 ...
Installed products updated.
Verifying : gpxe-roms-qemu-0.9.7-6.9.el6.noarch 1/8
Verifying : spice-server-0.8.2-5.el6.x86_64 2/8
Verifying : 2:qemu-img-0.12.1.2-2.209.el6.x86_64 3/8
Verifying : vgabios-0.6b-3.6.el6.noarch 4/8
Verifying : 2:qemu-kvm-0.12.1.2-2.209.el6.x86_64 5/8
Verifying : sgabios-bin-0-0.3.20110621svn.el6.noarch 6/8
Verifying : seabios-0.6.1.2-8.el6.x86_64 7/8
Verifying : celt051-0.5.1.3-0.el6.x86_64 8/8
Installed:
qemu-kvm.x86_64 2:0.12.1.2-2.209.el6
Dependency Installed:
celt051.x86_64 0:0.5.1.3-0.el6 gpxe-roms-qemu.noarch 0:0.9.7-6.9.el6
qemu-img.x86_64 2:0.12.1.2-2.209.el6 seabios.x86_64 0:0.6.1.2-8.el6
sgabios-bin.noarch 0:0-0.3.20110621svn.el6 spice-server.x86_64 0:0.8.2-5.el6
vgabios.noarch 0:0.6b-3.6.el6
Complete!