Yum:Yellow dog Updater, Modified
yum install –downloadonly 只下载而不安装
yum install –downloadonly –downloaddir=/tmp 下载到指定路径
[在CentOS/RHEL 6或更早期的版本中,你需要安装一个单独yum插件(名称为 yum-plugin-downloadonly)才能使用–downloadonly命令选项]
yumdownloader //下载到pwd

yum localinstall 自动依赖安装一个本地包
yum check-update 列出任何可更新的软件清单
yum update 安装任何更新软件
yum install example* 仅安装指定的软件
yum update example* 仅更新指定的软件
yum remove xxx 删除
yum search example* 搜索指定的软件

yum list 列出任何可安裝的软件清单
yum list updates 列出任何可更新的软件包
yum list installed 列出任何已安装的软件包
yum list extras 列出任何已安装但不在 Yum Repository 內的软件包

yum info *** 获取软件包信息
yum info updates 列出任何可更新的软件包信息
yum info installed 列出任何已安裝的软件包信息
yum info extras 列出任何已安裝但不在 Yum Repository 內的软件包信息
yum provides 列出软件包提供哪些文档

yum clean
yum clean all 清除缓存目录(/var/cache/yum)下的软件包及旧的headers

3 thoughts on - YUM工具

  • yum search buildrpmtree | less 寻找在名称或描述中包含某个符串的组件
    yum-config-manager –enable c6-media
    yum-config-manager –disable c6-media 在命令行中启用或者禁用一个软件源,(仅针对 CentOS 6 – 对 CentOS 5 无效)

    要令 yum 应用代理服务器,你首先要 /etc/yum.conf 内加入下列参数:
    当中 yourproxy 是你想访问的代理服务器的名称,而 8080 是代理端口。假如服务器需要验证,你可以这样指定登录凭证:
    rpm 组件管理员则利用代理环境变量。它们可以在 /etc/profile 里为全系统设置,或在 ~/.bash_profile 里为个别用户设置:
    export http_proxy=http://yourproxy:8080/ export ftp_proxy=http://yourproxy:8080/

    yum –nogpgcheck localinstall packagename.arch.rpm 本地化安装

  • man yum ,以及测试(centos 6.4版本)后,我认为,update 与 upgrade 并没有实质性的区别。网上说:

    yum -y update
    yum -y upgrade
    update If run without any packages, update will update every currently installed package. If one or more packages or package globs are specified, Yum will only update the listed
    packages. While updating packages, yum will ensure that all dependencies are satisfied. (See Specifying package names for more information) If the packages or globs speci-
    fied match to packages which are not currently installed then update will not install them. update operates on groups, files, provides and filelists just like the “install”

    If the main obsoletes configure option is true (default) or the –obsoletes flag is present yum will include package obsoletes in its calculations – this makes it better
    for distro-version changes, for example: upgrading from somelinux 8.0 to somelinux 9.

    Note that “update” works on installed packages first, and only if there are no matches does it look for available packages. The difference is most noticeable when you do
    “update foo-1-2” which will act exactly as “update foo” if foo-1-2 is installed. You can use the “update-to” if you’d prefer that nothing happen in the above case.

    Is the same as the update command with the –obsoletes flag set. See update for more details.


Captcha Code