RHEL5配置YUM从本地光盘更新软件

YUM客户端配置

配置文件内容简介:

[ ]内的是仓库的名字

name是仓库的描述也可以说是名字

baseurl 仓库的位置

enabled 是否启用这个仓库,1为起用,0为禁用

gpgcheck 是否检查GPG签名(用来验证要安装的包是不是REDHAT官方的)

GPGKEY 的存放地址我们需要用下面的命令导入这个签名。才能使用这项功能

 

[root@bogon ~]mount /mnt/cdrom  /mnt    //挂载光盘

[root@bogon ~]# cd /etc/yum.repos.d

[root@bogon yum.repos.d]# cp rhel-debuginfo.repo  rhel-debuginfo.repo.bak

[root@bogon ~]# vi rhel-debuginfo.repo

[rhel-debuginfo]

name=testYUM

baseurl=file:///mnt/Server

enabled=1    //这一定要改为1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 

[Cluster]

name=Cluster

baseurl=file:///mnt/Cluster

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 

[VT]

name=VT

baseurl=file:///mnt/VT

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 

[ClusterStorageo]

name=testYUM

baseurl=file:///mnt/ClusterStorage

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 

[root@bogon ~]# yum clean all          //清除缓存及旧的包

[root@bogon ~]# yum install httpd      //测试安装httpd

Loaded plugins: rhnplugin, security

This system is not registered with RHN.

RHN support will be disabled.

rhel-debuginfo                                           | 1.3 kB     00:00    

rhel-debuginfo/primary                                   | 753 kB     00:00    

rhel-debuginfo                                                        2348/2348

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package httpd.i386 0:2.2.3-43.el5 set to be updated

rhel-debuginfo/filelists                                 | 2.4 MB     00:00    

--> Finished Dependency Resolution

 

Dependencies Resolved

 

================================================================================

 Package       Arch         Version                Repository              Size

================================================================================

Installing:

 httpd         i386         2.2.3-43.el5           rhel-debuginfo         1.2 M

 

Transaction Summary

================================================================================

Install       1 Package(s)

Upgrade       0 Package(s)

 

Total download size: 1.2 M

Is this ok [y/N]: y

Downloading Packages:

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 37017186

rhel-debuginfo/gpgkey                                    | 1.1 kB     00:00    

Importing GPG key 0x37017186 "Red Hat, Inc. (release key) <security@redhat.com>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Is this ok [y/N]: y

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

  Installing     : httpd                                                    1/1

 

Installed:

  httpd.i386 0:2.2.3-43.el5

 

[root@bogon ~]# yum remove httpd   //删除httpd