用户名: 密码: 免费注册 忘记密码? 网站地图 | 加入收藏 | 设为首页
首页 | 新闻 | 工具 | 系统 | 办公 | 聊天 | 多媒体 | 网页 | 运营 | 平面 | 欣赏 | 数据库 | 程序 | 服务器 | 组网
网页 | 3dmax | Ghost | Windows Xp| Dreamweaver | photoshop | Flash | office | Alexa | Css | QQ | Asp | PHP | Jsp | Access
Flash MX 2004入门 | 网站推广策略 | CorelDRAW入门 | ASP学习 | 网站建设大师功 | Word入门
  iTbulo.com > 学院 > 操作系统教程 > Linux教程 > 文章正文
你知道么?Yum让你随时拥有最新的Fedora
iTbulo.COM 2005-12-12 未知()

使用Yum

使用Yum要做的第一件事情是更新其RPM header(文件头)列表。每一个RPM都有一个header,其中包含了完整的文件列表、软件包描述、实现的功能和提供的库、所需要的东西以及有什么冲突。Yum正是使用这些信息来决定如何升级和安装软件包的。

下面就来解决这个问题,输入以下命令:

yum check-update



运行这个命令,Yum将从yum.conf文件中指定的软件包服务器上下载当前的完整header文件列表。这个过程通常需要花费一定的时间,并且会有如下的一些显示信息:

Gathering header information file(s) from server(s)
Server: Fedora Core 1 - i386 - Base
Server: Fedora Core 1 - i386 - Released Updates
Finding updated packages
Downloading needed 
headers
getting /var/cache/yum/updates-released
/headers/pango-0-1.2.5-4.i386.hdr
pango-0-1.2.5-4.i386.hdr  
100% |=======| 6.5 kB    00:02
......



当上述的步骤完成之后,说明Yum已经下载完了所有的header文件。如果想让现在系统上安装的所有软件都处于最新的状态,只需使用以下命令:

yum update



Yum会将现在系统上安装的所有软件和目前的软件仓库服务器上的软件进行比较,比较完成后,它会给出一个有关细节的信息列表让用户确认,列表的内容如下所示:

Gathering header information file(s) from server(s)
Server: Fedora Core 1 - i386 - Base
Server: Fedora Core 1 - i386 - Released Updates
Finding updated packages
Downloading needed headers
Resolving dependencies
Dependencies resolved
I will do the following:
[install: kernel 2.4.22-1.2188.nptl.i686]
[update: pango 1.2.5-4.i386]
......
[update: XFree86-font-utils 4.3.0-55.i386]
Is this ok [y/N]:y



在本例中,Yum告诉我有76个可用更新(因为我进行测试的系统在安装完Fedora以后还从来没有更新过)。要安装所有这些更新,所要做的只是输入“y”即可。如果想更新的只是某一个特定的软件,可以将上述命令稍做修改:

yum update nmap



会看到如下所述的内容:

Gathering header information file(s) from server(s) 
Server: Fedora Core 1 - i386 - Base 
Server: Fedora Core 1 - i386 - Released Updates 
Finding updated packages 
Downloading needed headers 
No Packages Available for Update 
No actions to take



在上述的例子中,Yum告诉我,我的系统上的nmap已经是最新版本了,因此无需进行任何升级。下面我们来看一看如何安装一个机器上没有的软件包,比如要安装的是XChat IRC客户端,只需要输入以下命令即可:

yum install xchat



可能会看到如下信息:

Gathering header information file(s) from server(s)
Server: Fedora Core 1 - i386 - Base
Server: Fedora Core 1 - i386 - Released Updates
Finding updated packages
Downloading needed headers
Resolving dependencies
Dependencies resolved
I will do the following:
[install: xchat 1:2.0.7-1.FC1.0.i386]
Is this ok [y/N]:



按“y”就可以进行软件的安装,会出现下列内容提示安装成功:

Getting xchat-2.0.7-1.FC1.0.i386.rpm
xchat-2.0.7-1.FC1.0.i386.
100% |==========| 1.1 MB    01:51
Running test transaction:
Test transaction complete, Success!
xchat 100 % done 1/1
Installed:  xchat 1:2.0.7-1.FC1.0.i386
Transaction(s) Complete



虽然我的机器上的namp已经不需要再进行升级,不过我还想为其安装一个GUI界面,但又不知道需要什么软件包,这时只需要输入以下命令:

yum search nmap gui



可能看到的内容如下:

Gathering header information file(s) from server(s)
Server: Fedora Core 1 - i386 - Base
Server: Fedora Core 1 - i386 - Released Updates
Finding updated packages
Downloading needed headers
Looking in available packages for a providing package
Available package: redhat-config-printer-gui.i386 
0:0.6.79.5-1 from updates-released matches with 
redhat-config-printer-gui
Available package: nmap.i386 2:3.48-1 
from base matches with nmap
Available package: nmap-frontend.i386 
2:3.48-1 from base matches with
Available package: nmap-frontend.i386 
2:3.48-1 from base matches with nmap-frontend
......
2 results returned



如果现在需要一个并不是独立软件包的库文件,比如libc6.1-1.so.2,可以通过以下命令获取:

yum provides libc6.1-1.so.2



该命令会显示以下信息:

Gathering header information file(s)
from server(s) 
Server: Fedora Core 1 - i386 - Base 
Server: Fedora Core 1 - i386 - Released Updates 
Finding updated packages 
Downloading needed headers 
Looking in available packages for a providing package 
Available package: compat-libstdc++.i386 
0:7.3-2.96.118 from base matches with 
libstdc++-libc6.1-1.so.2 
Available package: compat-libstdc++.i386 
0:7.3-2.96.118 from base matches with 
libstdc++-libc6.1-1.so.2(GCC.INTERNAL) 
2 results returned 
Looking in installed packages for a providing package 
No packages found



Yum告知所查询的库位于compat-libstdc++的软件包中,并且现在还没有安装到本地系统上,所以只需要输入命令“yum install compat-libstdc++”即可完成该库的安装。如果要删除系统中的某软件,只需要输入以下命令:

yum remove nmap



该命令将会删除该软件包以及所有与之相关联的软件包。

在Yum升级或者安装软件时,它并不会自动清除磁盘缓冲区,所以要手动来完成这个过程。所幸的是这个过程非常简单,只需要输入以下命令即可:

yum clean all



该命令会删除所有缓冲区中的软件包以及所有不再需要的RPM header。如果要查看某一软件在本系统上的安装情况,可以使用以下命令:

yum info xchat



将会出现如下提示:

Gathering header information file(s) 
from server(s)
Server: Fedora Core 1 - i386 - Base
Server: Fedora Core 1 - i386 - Released Updates
Finding updated packages
Downloading needed headers
Looking in Available Packages:
Looking in Installed Packages:
Name   : xchat
Arch   : i386
Version: 2.0.7
Release: 1.FC1.0
Size   : 2.77 MB
Group  : 应用程序/互联网
Repo   : Locally Installed
Summary: GTK+ IRC (聊天) 客户。
Description:
X-Chat 是一个 X 窗口系统和 GTK+ 的 IRC 客户。
X-Chat 使用简便并包括一个好看的界面。

上一页  [1] [2] [3] [4] 下一页

文章搜索
相关资讯
相关文章 相关下载
没有相关文章
焦点信息