ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Red Hat Enterprise Linux Server release 6.2配置被动yum

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

原创 Linux操作系统 作者:yangzhangyue 时间:2013-08-08 10:57:10 0 删除 编辑
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
--> Running transaction check
---> Package gtk-vnc.x86_64 0:0.3.10-3.el6 will be installed
---> Package gtk-vnc-python.x86_64 0:0.3.10-3.el6 will be installed
--> 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 http://public-yum.oracle.com/public-yum-ol6.repo
--2013-08-09 21:08:53--  http://public-yum.oracle.com/public-yum-ol6.repo
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=http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol6_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/addons/$basearch/
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=http://public-yum.oracle.com/repo/OracleLinux/OL6/0/base/$basearch/
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=http://public-yum.oracle.com/repo/OracleLinux/OL6/1/base/$basearch/
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=http://public-yum.oracle.com/repo/OracleLinux/OL6/2/base/$basearch/
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=http://public-yum.oracle.com/repo/OracleLinux/OL6/3/base/$basearch/
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=http://public-yum.oracle.com/repo/OracleLinux/OL6/4/base/$basearch/
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=http://public-yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/$basearch/
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=http://public-yum.oracle.com/repo/OracleLinux/OL6/UEK/base/$basearch/
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=http://public-yum.oracle.com/repo/OracleLinux/OL6/playground/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

[ol6_MySQL]
name=MySQL for Oracle Linux 6 ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/MySQL/$basearch/
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=http://public-yum.oracle.com/repo/OracleLinux/OL6/gdm_multiseat/$basearch/
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
--> Running transaction check
---> Package kmod-oracleasm.x86_64 0:2.0.6.rh1-2.el6 will be installed
--> Processing Dependency: kernel(kmem_cache_alloc_trace) = 0x2044fa9e for package: kmod-oracleasm-2.0.6.rh1-2.el6.x86_64
--> Processing Dependency: kernel >= 2.6.32-358.el6 for package: kmod-oracleasm-2.0.6.rh1-2.el6.x86_64
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32-358.14.1.el6 will be installed
--> Processing Dependency: kernel-firmware >= 2.6.32-358.14.1.el6 for package: kernel-2.6.32-358.14.1.el6.x86_64
--> Running transaction check
---> Package kernel-firmware.noarch 0:2.6.32-220.el6 will be updated
---> Package kernel-firmware.noarch 0:2.6.32-358.14.1.el6 will be an update
--> Processing Conflict: kernel-2.6.32-358.14.1.el6.x86_64 conflicts bfa-firmware < 3.0.3.1
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package bfa-firmware.noarch 0:3.0.0.0-1.el6 will be updated
---> Package bfa-firmware.noarch 0:3.0.3.1-1.el6 will be an update
--> 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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-07-09

  • 博文量
    36
  • 访问量
    219781