QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3588|回复: 9

在fedora中使用yum简化rpm包管理[zt]

[复制链接]
发表于 2004-5-28 16:01:15 | 显示全部楼层 |阅读模式
一. yum是什么
yum = Yellow dog Updater, Modified
主要功能是更方便的添加/删除/更新RPM包.
它能自动解决包的倚赖性问题.
它能便于管理大量系统的更新问题
注:为什么要使用yum而不用apt,最简单的原因,Fedora自带

二. yum特点
*可以同时配置多个资源库(Repository)
*简洁的配置文件(/etc/yum.conf)
*自动解决增加或删除rpm包时遇到的倚赖性问题
*使用方便
*保持与RPM数据库的一致性

三. yum安装
Fedora自带
#rpm -ivh yum-2.0.4-2.noarch.rpm

四. yum配置
注:修改和增加配置文件中的资源库,加快下载速度和拥有更多可更新的rpm包
将/etc/yum.conf的内容全部替换为
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=fedora-release
tolerant=1
exactarch=1

[fedora-us-1]
name=Fedora Core 1 -- Fedora US mirror
baseurl=ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/os

[fedora-us-1-updates]
name=Fedora Core 1 updates -- Fedora US mirror
baseurl=ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/updates

[fedora-us-1-stable]
name=Fedora Linux (stable) for Fedora Core 1 -- Fedora US mirror
baseurl=ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/stable

[freshrpms]
name=Fedora Linux $releasever - $basearch - freshrpms
baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms



五. yum应用
注:当第一次使用yum或yum资源库有更新时,yum会自动下载所有所需的headers放置于/var/cache/yum目录下,所需时间可能较长.
//检查有哪些可更新的rpm包
#yum check-update
//安装rpm包,使xmms可以播放mp3
#yum install xmms-mp3
//安装mplayer,同时自动安装相关的软件
#yum install mplayer
//删除licq包,同时删除与该包有倚赖性的包
#yum remove licq
注:同时会提示删除licq-gnome,licq-qt,licq-text,非常方便
//系统更新(更新所有可以升级的rpm包,包括kernel)
#yum -y update
//每天定期执行系统更新
#chkconfig yum on
#service yum start


六. yum指令详解
*rpm包的更新
//检查可更新的rpm包
#yum check-update
//更新所有的rpm包
#yum update
//更新指定的rpm包,如更新kernel和kernel source
#yum update kernel kernel-source
//大规模的版本升级,与yum update不同的是,连旧的淘汰的包也升级
#yum upgrade
*rpm包的安装和删除
//安装rpm包,如xmms-mp3
#yum install xmms-mp3
//删除rpm包,包括与该包有倚赖性的包
#yum remove licq
注:同时会提示删除licq-gnome,licq-qt,licq-text
*yum暂存(/var/cache/yum/)的相关参数
//清除暂存中rpm包文件
#yum clean packages
//清除暂存中rpm头文件
#yum clearn headers
//清除暂存中旧的rpm头文件
#yum clean oldheaders
//清除暂存中旧的rpm头文件和包文件
#yum clearn 或#yum clearn all
注:相当于yum clean packages + yum clean oldheaders
*rpm包列表
//列出资源库中所有可以安装或更新的rpm包
#yum list
//列出资源库中特定的可以安装或更新以及已经安装的rpm包
#yum list mozilla
#yum list mozilla*
注:可以在rpm包名中使用匹配符,如列出所有以mozilla开头的rpm包
//列出资源库中所有可以更新的rpm包
#yum list updates
//列出已经安装的所有的rpm包
#yum list installed
//列出已经安装的但是不包含在资源库中的rpm包
#yum list extras
注:通过其它网站下载安装的rpm包
*rpm包信息显示(info参数同list)
//列出资源库中所有可以安装或更新的rpm包的信息
#yum info
//列出资源库中特定的可以安装或更新以及已经安装的rpm包的信息
#yum info mozilla
#yum info mozilla*
注:可以在rpm包名中使用匹配符,如列出所有以mozilla开头的rpm包的信息
//列出资源库中所有可以更新的rpm包的信息
#yum info updates
//列出已经安装的所有的rpm包的信息
#yum info installed
//列出已经安装的但是不包含在资源库中的rpm包的信息
#yum info extras
注:通过其它网站下载安装的rpm包的信息
*搜索rpm包
//搜索匹配特定字符的rpm包
#yum search mozilla
注:在rpm包名,包描述等中搜索
//搜索有包含特定文件名的rpm包
#yum provides realplay

七. 安全的更新freshrpms.net的rpm包
//安装freshrpms.net的GPG key
#rpm --import http://freshrpms.net/packages/build...G-KEY.freshrpms
//编辑/etc/yum.conf,增加以下信息到尾部
[freshrpms]
name=Fedora Linux $releasever - $basearch - freshrpms
baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms
gpgcheck=1

注: //检查GPG Key
# rpm -qa gpg-pubkey*
//显示Key信息
#rpm -qi gpg-pubkey-e42d547b-3960bdf1
//删除Key
#rpm -e gpg-pubkey-e42d547b-3960bdf1

本文转自linuxsir.org 作者为:victoryan
发表于 2004-5-28 16:09:09 | 显示全部楼层
好东西!!!!!


就是看它的使用方法好象挺复杂的。。。我正想装FC1呢。。。     
回复

使用道具 举报

 楼主| 发表于 2004-5-28 16:24:43 | 显示全部楼层
这还复杂?帮你解决了软件来源,依赖关系你还有不足。
回复

使用道具 举报

发表于 2004-10-11 22:02:03 | 显示全部楼层
可以设置代理不?怎么设置?
回复

使用道具 举报

发表于 2004-10-12 02:58:21 | 显示全部楼层
拷贝APT嘛!
回复

使用道具 举报

发表于 2004-10-12 04:41:27 | 显示全部楼层
HEW兄你不是说自己不喜欢FC的吗?
回复

使用道具 举报

发表于 2004-10-19 01:29:01 | 显示全部楼层
收藏
回复

使用道具 举报

发表于 2004-10-19 09:47:49 | 显示全部楼层
我尝试用yum clean oldheaders,结果没有任何反应,man yum以后发现

[code:1]CLEAN OPTIONS
       The following are the ways which you can invoke yum in clean mode.

       yum clean packages
              Eliminate  any cached packages from the system.  Note that pack-
              ages are not automatically deleted after they are downloaded.

       yum clean headers
              Eliminate all of the files  which  yum  uses  to  determine  the
              remote  availability  of  packages. Using this option will force
              yum to download all the headers the next time it is run.

       yum clean all
              Runs yum clean packages and yum clean headers as above.[/code:1]
没有有关删除旧的包和头文件的解释。

yum的版本是2.1.7
回复

使用道具 举报

发表于 2004-10-19 16:06:49 | 显示全部楼层
顺便说一下rhel 3的升级问题,大家都知道现在的下载版本的rhel3 可以升级到u2版本,但是要到u3版本现在还是只有注册过的用户才可以,这里推荐一个centos介绍如下:

CentOS 3.3, based on Redhat Enterprise Linux Update 3, has been released for i386 and AMD64

This is a complete rebuild of all the updated packages that Red Hat has included in the SRPM's of their Enterprise Linux 3 Update 3.

The changed packages from update 3 are overlaid onto 3.1. This release includes a rebuilt anaconda and new boot kernels for the installer.

Known Problems:
OpenOffice does not function without openoffice.org-i18n installed. We believe this is NOT unique to centos but consistent with RHEL3U3 functionality.

On the ISO's, comps.rpm does not have the correct hdlists in place for cd support from redhat-config-packages. This should be fixed before long. However, it was not practical to re-roll the isos for this.

An updated comps package will be released which fixes this problem. In addition, a few errors in packages listed in the comps.xml file will be corrected.

yum: yum 2.0.8 did not know about the ia32e or nocona processors so it cannot install those kernels on x86_64 systems using those chips. A future version of yum will correct this.  

虽说是个patch过的版本,不过稳定性不错,需要的朋友可以试试。
这里再重申一遍,linux的各种版本虽然很多,如何挑选还是看你实际的需要,稳定还是求新,就像鱼和熊掌的道理一样,我觉得还是选其一好,两个都要顾及的话很累的。
回复

使用道具 举报

发表于 2004-10-22 22:03:31 | 显示全部楼层
请问需要用户名和密码的代理怎么设置啊?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-6-7 06:16 , Processed in 0.066831 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表