Chinaunix首页 | 论坛 | 博客
  • 博客访问: 10735332
  • 博文数量: 2905
  • 博客积分: 20098
  • 博客等级: 上将
  • 技术积分: 36298
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-23 05:00
文章存档

2012年(1)

2011年(3)

2009年(2901)

分类: LINUX

2009-03-23 11:11:12

Yum(全称为 Yellow dog Updater, Modified)是一个在Fedora中的shell前端软件包管理器。基于rpm包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软体包,无须繁琐地一次次下载、安装。
  软体包来源
  可供Yum下载的软体包包括fedora 本身的软体包以及源自rpm.livna.org的Fedora Extras,全部是由Linux社区维护的,并且基本是自由软体。所有的包都有一个独立的GPG签名,主要是为了你的系统安全。而对于Fedora core 4.0 的用户,rpm.livna.org 的签名是自动导入并安装的。
  图形化前端
  Yum的图形化前端主要有yumex和kyum。它们并不是独立于Yum的,而是Yum的图形前端,也就是说在安装和使用Yumex和kyum同时,都是以Yum的安装和配置为基础;所以在用Yumex或kyum 时,必须先安装配置Yum。
一.做好准备工作.
1.安装FTP,一般都是通过FTP来下载软件包.
安装好后启动它.
2.现在进行拷贝文件.
把光盘里的所有文件都拷贝到/var/ftp/pub/下面.实际上只拷贝Server 和VT两个文件过去就行了,还可以不用把全部RPM安装软件包拷贝过去,太多了,一共2.4G左右,如果系统一开始安装分配给var的空间不够就可以这样做.
完成后切换到/var/ftp/pub/目录下
删除*.html
删除Server/repodata/TRANS.TBL
删除VT/repodata/TRANS.TBL
以上是建议删除的,不删除也可以.
二.配置客户端
进去后添加如下内容.注意看清了内容很类似.
配置文件内容简介:
[ ]内的是仓库的名字
name仓库的描述
baseurl 是你的YUM源地址,因为这里配置的是FTP,还可以是HTTP,FILE等
enabled 是否启用这个仓库,1为起用,0为禁用
gpgcheck 是否检查GPG签名(用来验证要安装的包是不是REDHAT官方的)
GPGKEY 的存放地址需要用下面的命令到入这个签名。才能使用这项功能
 
三.配置服务器
安装createrepo工具,然后用这个工具生成YUM通用数据库.
可看到一个是安装,两个操作,很类似的.也可以看到是成功的.
这样就OK下
四.下面看下yum的命令和进行测试.
   1. yum install 这里是安装下载的软件包,由于本实验没有提供FTP下载.
   2.yum localinstall 本地安装软件包,在这里本服务器做YUM源.看个例子.
   
[root@rhel5 /]# yum localinstall /var/ftp/pub/Server/dhcp*
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Local Package Process
Examining /var/ftp/pub/Server/dhcp-3.0.5-3.el5.i386.rpm: dhcp - 12:3.0.5-3.el5.i386
Examining /var/ftp/pub/Server/dhcp-devel-3.0.5-3.el5.i386.rpm: dhcp-devel - 12:3.0.5-3.el5.i386
Examining /var/ftp/pub/Server/dhcpv6-0.10-33.el5.i386.rpm: dhcpv6 - 0.10-33.el5.i386
Examining /var/ftp/pub/Server/dhcpv6_client-0.10-33.el5.i386.rpm: dhcpv6_client - 0.10-33.el5.i386
Marking /var/ftp/pub/Server/dhcp-3.0.5-3.el5.i386.rpm to be installed
Setting up repositories
Reading repository metadata in from local files
Marking /var/ftp/pub/Server/dhcp-devel-3.0.5-3.el5.i386.rpm to be installed
Setting up repositories
Reading repository metadata in from local files
Marking /var/ftp/pub/Server/dhcpv6-0.10-33.el5.i386.rpm to be installed
Setting up repositories
Reading repository metadata in from local files
Marking /var/ftp/pub/Server/dhcpv6_client-0.10-33.el5.i386.rpm to be installed
Setting up repositories
Reading repository metadata in from local files
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package dhcp.i386 12:3.0.5-3.el5 set to be updated
---> Package dhcpv6.i386 0:0.10-33.el5 set to be updated
---> Package dhcpv6_client.i386 0:0.10-33.el5 set to be updated
---> Package dhcp-devel.i386 12:3.0.5-3.el5 set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 dhcp                    i386       12:3.0.5-3.el5   /var/ftp/pub/Server/dhcp-3.0.5-3.el5.i386.rpm  2.1 M
 dhcp-devel              i386       12:3.0.5-3.el5   /var/ftp/pub/Server/dhcp-devel-3.0.5-3.el5.i386.rpm  1.4 M
 dhcpv6                  i386       0.10-33.el5      /var/ftp/pub/Server/dhcpv6-0.10-33.el5.i386.rpm  759 k
 dhcpv6_client           i386       0.10-33.el5      /var/ftp/pub/Server/dhcpv6_client-0.10-33.el5.i386.rpm  161 k
Transaction Summary
=============================================================================
Install      4 Package(s)        
Update       0 Package(s)        
Remove       0 Package(s)        
Total download size: 4.4 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: dhcp                         ######################### [1/4]
  Installing: dhcpv6                       ######################### [2/4]
  Installing: dhcpv6_client                ######################### [3/4]
  Installing: dhcp-devel                   ######################### [4/4]
Installed: dhcp.i386 12:3.0.5-3.el5 dhcp-devel.i386 12:3.0.5-3.el5 dhcpv6.i386 0:0.10-33.el5 dhcpv6_client.i386 0:0.10-33.el5
Complete!
[root@rhel5 /]#
 
3.yum update 全部更新
[root@rhel5 /]# yum update
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Update Process
Setting up repositories
Reading repository metadata in from local files
No Packages marked for Update/Obsoletion

4.yum update package 更新指定程序包package
5.yum check-update
[root@rhel5 /]# yum check-update
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up repositories
Reading repository metadata in from local filesck-update

6.yum info 显示安装包信息
7.yum list 显示所有已经安装和可以安装的程序包
8.yum list 显示指定程序包安装情况
9.yum search 查找软件包
[root@rhel5 /]# yum search "dhcp*"
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up repositories
Reading repository metadata in from local files
 
dhcpv6_client.i386                       0.10-33.el5            installed      
Matched from:
dhcpv6_client
DHCPv6 client
Provides the client for the DHCPv6 protocol (RFC 3315) to support
dynamic configuration of IPv6 addresses and parameters.
See man dhcp6c(8), dhcp6c.conf(5), and the documentation in
/usr/share/dhcpv6_client* .
阅读(889) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~