Red Hat Enterprise Linux Server release 6.2配置被動yum

yangzhangyue發表於2013-08-08
yum
yum是透過分析分析rpm的標題資料後,根據各軟體的相關行製作出屬性依賴時的解決方案,然後可以自動處理軟體的依賴屬性問題,以解決軟體安裝
或刪除與升級的問題。

#mkdir /mnt/vcdrom

注:建立一個目錄用來作掛接點(mount point)
1、掛在iso檔案
[root@localhost yum.repos.d]# cd /media
[root@localhost media]# mkdir mnt
[root@localhost media]# mount -o loop -t iso9660 /u02/
lost+found/           OL6.2 x86_64 Dis.iso  
[root@localhost media]# mount -o loop -t iso9660 /u02/OL6.2\ x86_64\ Dis.iso  /media/mnt/
2、安裝createrepo
createrepo是配置YUM源的配置工具,檢查當前是否已經安裝createrepo包的安裝情況:
[root@localhost Packages]# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm
warning: createrepo-0.9.8-4.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
        deltarpm is needed by createrepo-0.9.8-4.el6.noarch
        python-deltarpm is needed by createrepo-0.9.8-4.el6.noarch
[root@localhost Packages]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
warning: python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
        deltarpm = 3.5-0.5.20090913git.el6 is needed by python-deltarpm-3.5-0.5.20090913git.el6.x86_64
[root@localhost Packages]# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
warning: deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:deltarpm               ########################################### [100%]
[root@localhost Packages]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
warning: python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:python-deltarpm        ########################################### [100%]
[root@localhost Packages]# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm
warning: createrepo-0.9.8-4.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]
[root@localhost yum]# cp -r /media/mnt/ /u02/yum/

3、建立yum repository的xml-rpm-metadata
createrepo  -g  /u02/yum/mnt/Server/repodata/repomd.xml  /u02/yum/mnt/Server/
createrepo  -g  /u02/yum/mnt/HighAvailability/repodata/repomd.xml  /u02/yum/mnt/HighAvailability/
createrepo  -g  /u02/yum/mnt/LoadBalancer/repodata/repomd.xml  /u02/yum/mnt/LoadBalancer/
createrepo  -g  /u02/yum/mnt/ResilientStorage/repodata/repomd.xml  /u02/yum/mnt/ResilientStorage/
4、建立本地yum客戶端的repo檔案
[root@localhost mnt]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
total 0
[root@localhost yum.repos.d]# vi local.repo

[HighAvailability]
name= HighAvailability
baseurl=file:/u02/yum/mnt/HighAvailability
enabled=1
gpgcheck=0
gpgkey=file:/u02/yum/mnt/RPM-GPG-KEY-oracle

[LoadBalancer]
name= LoadBalance
baseurl=file:/u02/yum/mnt/LoadBalancer
enabled=1
gpgcheck=0
gpgkey=file:/u02/yum/mnt/RPM-GPG-KEY-oracle

[ResilientStorage]
name=ResilientStorage
baseurl=file:/u02/yum/mnt/ResilientStorage
enabled=1
gpgcheck=0
gpgkey=file:/u02/yum/mnt/RPM-GPG-KEY-oracle

[Server]
name=Server
baseurl=file:/u02/yum/mnt/Server
gpgcheck=0
enabled=1
gpgkey=file:/u02/yum/mnt/RPM-GPG-KEY-oracle

使用yum安裝rpm包
[root@localhost yum.repos.d]# yum install gtk-vnc*
Loaded plugins: security
Setting up Install Process
Resolving Dependencies
--&gt Running transaction check
---&gt Package gtk-vnc.x86_64 0:0.3.10-3.el6 will be installed
---&gt Package gtk-vnc-python.x86_64 0:0.3.10-3.el6 will be installed
--&gt Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                          Arch                     Version                         Repository                          Size
====================================================================================================================================
Installing:
 gtk-vnc                          x86_64                   0.3.10-3.el6                    HighAvailability                    95 k
 gtk-vnc-python                   x86_64                   0.3.10-3.el6                    HighAvailability                    17 k

Transaction Summary
====================================================================================================================================
Install       2 Package(s)

Total download size: 111 k
Installed size: 284 k
Is this ok [y/N]: y
Downloading Packages:
------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                               9.8 MB/s | 111 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : gtk-vnc-0.3.10-3.el6.x86_64                                                                                      1/2
  Installing : gtk-vnc-python-0.3.10-3.el6.x86_64                                                                               2/2

Installed:
  gtk-vnc.x86_64 0:0.3.10-3.el6                                 gtk-vnc-python.x86_64 0:0.3.10-3.el6                                

Complete!

新增oracle linux yum源
[root@localhost yum.repos.d]# wget
--2013-08-09 21:08:53-- 
Resolving public-yum.oracle.com... 137.254.56.43
Connecting to public-yum.oracle.com|137.254.56.43|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2778 (2.7K) [text/plain]
Saving to: “public-yum-ol6.repo”

100%[==========================================================================================>] 2,778       --.-K/s   in 0s     

2013-08-09 21:08:54 (128 MB/s) - “public-yum-ol6.repo” saved [2778/2778]

[root@localhost yum.repos.d]# ll
total 8
-rw-r--r--. 1 root root   98 Dec 13  2011 packagekit-media.repo
-rw-r--r--. 1 root root 2778 Jul 20 01:28 public-yum-ol6.repo
[root@localhost yum.repos.d]# more p
packagekit-media.repo  public-yum-ol6.repo   
[root@localhost yum.repos.d]# more public-yum-ol6.repo
[ol6_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol6_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_ga_base]
name=Oracle Linux $releasever GA installation media copy ($basearch)
baseurl=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_u1_base]
name=Oracle Linux $releasever Update 1 installation media copy ($basearch)
baseurl=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_u2_base]
name=Oracle Linux $releasever Update 2 installation media copy ($basearch)
baseurl=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_u3_base]
name=Oracle Linux $releasever Update 3 installation media copy ($basearch)
baseurl=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_u4_base]
name=Oracle Linux $releasever Update 4 installation media copy ($basearch)
baseurl=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_UEK_latest]
name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol6_UEK_base]
name=Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_playground_latest]
name=Latest mainline stable kernel for Oracle Linux 6 ($basearch) - Unsupported
baseurl=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_MySQL]
name=MySQL for Oracle Linux 6 ($basearch)
baseurl=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_gdm_multiseat]
name=Oracle Linux 6 GDM Multiseat ($basearch)
baseurl=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[root@localhost yum.repos.d]# yum install kmod-oracleasm
Loaded plugins: refresh-packagekit, security
ol6_UEK_latest                                                                                               | 1.2 kB     00:00    
ol6_UEK_latest/primary                                                                                       | 9.4 MB     00:05    
ol6_UEK_latest                                                                                                              211/211
ol6_latest                                                                                                   | 1.4 kB     00:00    
ol6_latest/primary                                                                                           |  31 MB     08:11    
ol6_latest                                                                                                              21943/21943
Setting up Install Process
Resolving Dependencies
--&gt Running transaction check
---&gt Package kmod-oracleasm.x86_64 0:2.0.6.rh1-2.el6 will be installed
--&gt Processing Dependency: kernel(kmem_cache_alloc_trace) = 0x2044fa9e for package: kmod-oracleasm-2.0.6.rh1-2.el6.x86_64
--&gt Processing Dependency: kernel >= 2.6.32-358.el6 for package: kmod-oracleasm-2.0.6.rh1-2.el6.x86_64
--&gt Running transaction check
---&gt Package kernel.x86_64 0:2.6.32-358.14.1.el6 will be installed
--&gt Processing Dependency: kernel-firmware >= 2.6.32-358.14.1.el6 for package: kernel-2.6.32-358.14.1.el6.x86_64
--&gt Running transaction check
---&gt Package kernel-firmware.noarch 0:2.6.32-220.el6 will be updated
---&gt Package kernel-firmware.noarch 0:2.6.32-358.14.1.el6 will be an update
--&gt Processing Conflict: kernel-2.6.32-358.14.1.el6.x86_64 conflicts bfa-firmware < 3.0.3.1
--&gt Restarting Dependency Resolution with new changes.
--&gt Running transaction check
---&gt Package bfa-firmware.noarch 0:3.0.0.0-1.el6 will be updated
---&gt Package bfa-firmware.noarch 0:3.0.3.1-1.el6 will be an update
--&gt Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                          Arch                    Version                                 Repository                   Size
====================================================================================================================================
Installing:
 kmod-oracleasm                   x86_64                  2.0.6.rh1-2.el6                         ol6_latest                   34 k
Updating:
 bfa-firmware                     noarch                  3.0.3.1-1.el6                           ol6_latest                  723 k
Installing for dependencies:
 kernel                           x86_64                  2.6.32-358.14.1.el6                     ol6_latest                   26 M
Updating for dependencies:
 kernel-firmware                  noarch                  2.6.32-358.14.1.el6                     ol6_latest                   11 M

Transaction Summary
====================================================================================================================================
Install       2 Package(s)
Upgrade       2 Package(s)

Total download size: 38 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): bfa-firmware-3.0.3.1-1.el6.noarch.rpm                                                                 | 723 kB     00:59    
(2/4): kernel-2.6.32-358.14.1.el6.x86_64.rpm                                                                 |  26 MB     27:20    
(3/4): kernel-firmware-2.6.32-358.14.1.el6.noarch.rpm                                                        |  11 MB     08:28    
(4/4): kmod-oracleasm-2.0.6.rh1-2.el6.x86_64.rpm                                                             |  34 kB     00:01    
------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                17 kB/s |  38 MB     36:57    
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
 Userid : Oracle OSS group (Open Source Software group)
 Package: 6:oraclelinux-release-6Server-2.0.2.x86_64 (@anaconda-OracleLinuxServer-201112121319.x86_64/6.2)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Is this ok [y/N]: n


Didn't install any keys

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29033984/viewspace-768016/,如需轉載,請註明出處,否則將追究法律責任。

相關文章