YUM详解之命令(二)

一、命令格式

# yum [options] < grouplist, localinstall, groupinfo, localupdate, resolvedep,
 erase, deplist, groupremove, makecache, upgrade, provides, shell, install, 
whatprovides, groupinstall, update, repolist, groupupdate, info, search, 
check-update, list, remove, clean, grouperase >

二、options详解

  • -h, –help #show this help message and exit 显示帮助文档
  • -t, –tolerant #be tolerant of errors
  • -C #run entirely from cache, don’t update cache
  • -c [config file] #config file location
  • -R [minutes] #maximum command wait time
  • -d [debug level] #debugging output level
  • -e [error level] #error output level
  • -q, –quiet #quiet operation 退出操作
  • -v, –verbose #verbose operation
  • -y #answer yes for all questions
  • –version #show Yum version and exit 查看版本
  • –installroot=[path] #set install root
  • –enablerepo=[repo] #enable one or more repositories (wildcards allowed)
  • –disablerepo=[repo] #disable one or more repositories (wildcards allowed)
  • -x [package], –exclude=[package] #exclude package(s) by name or glob
  • –disableexcludes=[repo] #disable exclude from main, for a repo or for everything
  • –obsoletes #enable obsoletes processing during updates
  • –noplugins #disable Yum plugins
  • –nogpgcheck #disable gpg signature checking
  • –disableplugin=[plugin] #disable plugins by name 禁用插件,一般使用的fastestmirror

三、操作详解

  • 查看系统中已经安装的和可用的软件组
# yum grouplist
  • 安装指定软件组中的软件包
# yum groupinstall <groupnames>
  • 卸载指定软件组中的软件包
# yum groupremove <groupnames>
  • 更新指定软件组中的软件包
# yum groupupdate <groupnames>
  • 查看软件包组信息
# yum groupinfo <groupnames>
  • 删除软件包组
# yum grouperase <groupnames>
  • 解决本地依赖包问题,很实用。假如在本地安装.rpm包时出现依赖报错,则可以使用yum localinstall <包名>
# yum localinstall <packages>
  • 如果有wine的新版本,而且你也下载到来本地,就可以这样本地更新wine了
# yum localupdate <packages>
  • 显示软件包的依赖信息
# yum deplist <packages>
  • 生产yum缓存.
# yum makecache
  • 检查可更新的所有软件包
# yum check-update
  • 下载更新系统已安装的所有软件包
# yum update
  • 更新指定的软件包
# yum update <packages>
  • 大规模的版本升级,与yum update不同的是,连旧的淘汰的包也升级
# yum upgrade
  • 更新指定的软件包
# yum upgrade <packages>
  • 检测软件包中包含的文件以及软件提供的功能,查找与正则表达式匹配的值
# yum provides <软件名字>
  • 查找指定文件由什么软件包提供
#yum whatprovides <软件名字>
  • 检测所有可用的软件的名称、描述、概述和已列出的维护者,查找与正则表达式匹配的值
# yum search <regex>
  • 安装新软件包
# yum install <packages>
  • 卸载指定的软件包
# yum remove <packages>
  • 清除缓存中的rpm头文件
# yum clean <options>
# yum clean headers
  • 清除缓存中rpm包文件
# yum clean packages
  • 清除缓存中的rpm头文件和包文件
# yum clean all
  • yum list [options]
 yum list 列出资源库中所有可以安装或更新以及已经安装的rpm包
 yum list <regex> 列出资源库中与正则表达式匹配的可以安装或更新以及已经安装的rpm包
 yum list available 列出资源库中所有可以安装的rpm包
 yum list available <regex> 列出资源库中与正则表达式匹配的所有可以安装的rpm包
 yum list updates 列出资源库中所有可以更新的rpm包
 yum list updates <regex> 列出资源库中与正则表达式匹配的所有可以更新的rpm包
 yum list installed 列出资源库中所有已经安装的rpm包
 yum list installed <regex> 列出资源库中与正则表达式匹配的所有已经安装的rpm包
 yum list extras 列出已经安装的但是不包含在资源库中的rpm包
 yum list extras <regex> 列出与正则表达式匹配的已经安装的但是不包含在资源库中的rpm包
 yum list recent 列出最近被添加到资源库中的软件包
  • yum info 命令列出包信息,yum info 可用的参数与 yum list 的相同

四、常见错误

  • 遇到“warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY”的解决办法
    这是由于yum安装了旧版本的GPG keys造成的,解决办法是可以运行下面命令:
# rpm --import /etc/pki/rpm-gpg/RPM*
  • Existing lock /var/run/yum.pid: another copy is running as pid
a、rm -rf /var/run/yum.pid
b、etc/init.d/yum-updatesd stop

YUM详解之配置(一):http://www.hangdaowangluo.com/archives/257

YUM详解之命令(二)》上有1条评论

  1. Pingback引用通告: YUM详解之配置(一) | 精彩每一天

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>