yum源的配置,请参考此文:RedHatLinux 本地yum源的配置。本文讲解如何使用yum命令。

[root@serv01 ~]# yum --help
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
Usage: yum [options] COMMAND List of Commands: check Check for problems in the rpmdb
check-update Check for available package updates
clean Remove cached data
deplist List a package's dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade downgrade a package
erase Remove a package or packages from your system
groupinfo Display details about a package group
groupinstall Install the packages in a group on your system
grouplist List available package groups
groupremove Remove the packages in a group from your system
help Display a helpful usage message
history Display, or use, the transaction history
info Display details about a package or group of packages
install Install a package or packages on your system
list List a package or groups of packages
load-transaction load a saved transaction from filename
makecache Generate the metadata cache
provides Find what package provides the given value
reinstall reinstall a package
repolist Display the configured software repositories
resolvedep Determine which package provides the given dependency
search Search package details for the given string
shell Run an interactive yum shell
update Update a package or packages on your system
upgrade Update packages taking obsoletes into account
version Display a version for the machine and/or available repos. Options:
-h, --help show this help message and exit
-t, --tolerant be tolerant of errors
-C, --cacheonly run entirely from system cache, don't update cache
-c [config file], --config=[config file]
config file location
-R [minutes], --randomwait=[minutes]
maximum command wait time
-d [debug level], --debuglevel=[debug level]
debugging output level
--showduplicates show duplicates, in repos, in list/search commands
-e [error level], --errorlevel=[error level]
error output level
--rpmverbosity=[debug level name]
debugging output level for rpm
-q, --quiet quiet operation
-v, --verbose verbose operation
-y, --assumeyes 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
--enableplugin=[plugin]
enable plugins by name
--skip-broken skip packages with depsolving problems
--color=COLOR control whether color is used
--releasever=RELEASEVER
set value of $releasever in yum config and repo files
--setopt=SETOPTS set arbitrary config and repo options Plugin Options: #不建议使用这种方式卸载
[root@serv01 ~]# yum remove nagios-common #yum安装的包,可以使用rpm命令查询到
[root@serv01 ~]# rpm -qa | grep httpd
httpd-tools-2.2.15-9.el6.x86_64
httpd-2.2.15-9.el6.x86_64
[root@serv01 ~]# ls /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf
#我们删除一个文件,再次安装
[root@serv01 ~]# rm -rf /etc/httpd/conf/httpd.conf
[root@serv01 ~]# ls /etc/httpd/conf/httpd.conf
ls: cannot access /etc/httpd/conf/httpd.conf: No such file or directory
#安装不成功
[root@serv01 ~]# yum install httpd -y
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
Package httpd-2.2.15-9.el6.x86_64 already installed and latest version
Nothing to do
#使用reinstall重装
[root@serv01 ~]# yum reinstall httpd -y
Installed:
httpd.x86_64 0:2.2.15-9.el6
Complete! #查询所有
[root@serv01 ~]# yum list
#可以安装的略
#查询httpd,有@表示已经安装
[root@serv01 ~]# yum list|grep httpd
httpd.x86_64 2.2.15-9.el6 @rhel-iso
httpd-tools.x86_64 2.2.15-9.el6 @rhel-iso
httpd-devel.i686 2.2.15-9.el6 rhel-iso
httpd-devel.x86_64 2.2.15-9.el6 rhel-iso
httpd-manual.noarch 2.2.15-9.el6 rhel-iso
#验证
[root@serv01 ~]# rpm -qa|grep httpd
httpd-tools-2.2.15-9.el6.x86_64
httpd-2.2.15-9.el6.x86_64 #软件组
[root@serv01 ~]# yum grouplist [root@serv01 ~]# yum grouplist | grep Devel
Additional Development
Desktop Platform Development
Development tools
Server Platform Development #安装软件组,注意需要有双引号
[root@serv01 ~]# yum groupinstall "Server Platform" -y #强烈不建议这样移除,这样很危险,可以看到最后把内核都移除了。
[root@serv01 ~]# yum groupremove "Server Platform" -y
[root@serv01 ~]# yum groupremove "Server Platform" --skip-broken --nogpgcheck #这样可以正确的使用groupinstall安装和使用groupremove移除,因为该软件组依赖不多
[root@serv01 ~]# yum groupinstall "Emacs" -y
Installed:
emacs.x86_64 1:23.1-21.el6
Complete!
[root@serv01 ~]# yum groupremove "Emacs" -y
Removed:
emacs.x86_64 1:23.1-21.el6 Complete!
我的邮箱:wgbno27@163.com  新浪微博:@Wentasy27
微信公众平台:JustOracle(微信号:justoracle)
数据库技术交流群:336882565(加群时验证 From CSDN XXX)
Oracle交流讨论组:https://groups.google.com/d/forum/justoracle By Larry Wen
 
@Wentasy 博文仅供参考,欢迎大家来访。如有错误之处,希望批评指正。原创博文如需转载请注明出处,谢谢 :) [CSDN博客]

yum命令的使用的更多相关文章

  1. linux yum命令详解

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  2. linux yum命令详解-转

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  3. linux yum 命令

    linux yum 命令 yum( Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器. 基於RPM包管理,能够从指 ...

  4. Linux系统yum命令安装软件时保留(下载)rpm包 -- 转载

    昨天在部署zabbix监控的时候,遇到一个问题:监控服务器处于无外网状态,在线安装不可用.而某些依赖包度娘或谷姐搜索起来也挺呛人的!于是想到一个办法,利用有外网的服务器的yum命令来安装这些软件,并自 ...

  5. 【转】linux yum命令详解

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  6. yum命令详解

    yum(全 称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载 ...

  7. yum命令指南

    yum check-update  检查可更新的所有软件包 yum update  下载更新系统已安装的所有软件包yum upgrade  大规模的版本升级,与yum update不同的是,连旧的淘汰 ...

  8. 最详细的Linux YUM命令使用教程

    YUM(Yellow dog Updater, Modified)为多个Linux发行版的前端软件包管理器,例如 Redhat RHEL, CentOS & Fedora.  YUM通过调用R ...

  9. 用于软件包管理的21个Linux YUM命令 转载

    http://flycars001.iteye.com/blog/1949085 YUM到底是啥东东? YUM(Yellowdog Updater Modified)是一款开源命令行及图形化软件包管理 ...

  10. yum命令指南-yum使用方法

    yum check-update  检查可更新的所有软件包    yum update  下载更新系统已安装的所有软件包    yum upgrade  大规模的版本升级,与yum update不同的 ...

随机推荐

  1. 垂直的TextView

    所先声明一下这个类是我从网上找到的一篇文章,只是保留并没有侵权的意思. public class TextViewVertical extends View { public static final ...

  2. nodejs简单层级结构配置文件

    在NodeJS中使用配置文件,有几种比较不错的方案:第一种:文件格式使用json是毋容置疑的好方案.格式标准,易于理解,文件内容读取到内存之后,使用JSON的标准分析函数即可得到配置项.第二种:将配置 ...

  3. PHP校验ISBN码的函数

    国际标准书号(International Standard Book Number,ISBN:拟发音is-ben),是国际通用的图书或独立的出版物(除定期出版的期刊)代码.出版社可以通过国际标准书号清 ...

  4. winform 防止多開

    場景: 當我們的電腦可以使用多用戶同時登錄時候,每個使用者只允許執行一次exe程式. 例如:一台公用電腦,有多個用戶A.B. 當用戶A進入系統第一次運行C:\XX.exe,OK.第二次運行XX.exe ...

  5. Solaris系统管理(二)资源管理与网络配置

    上一篇主要总结了Solaris安装后需要进行的一些设置,如ssh,pkgutil管理依赖,vim安装. 这一篇将会对Solaris资源管理与网络配置进行总结. 四 Solaris 系统管理 1,查询总 ...

  6. c 按范围快速指定整数

    以前用过octave, 和matlab类似的软件, 指定范围非常方便 i = 1:10:100;  就可以得到 10 20 30 ... 100 这一系列的数据, 但是在c里面, 必须手动写循环, 太 ...

  7. sqoop 初用

    http://blog.csdn.net/dbanote/article/details/8907650 目前版本的Sqoop中,使用自由形式查询导入,只提供简单的查询,没有复杂的和“OR”条件查询在 ...

  8. jqueryMobile

    <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8& ...

  9. [转]caffe+Ubuntu14.0.4 64bit 环境配置说明(无CUDA,caffe在CPU下运行) --for --Amd

    caffe是一个简洁高效的深度学习框架,具体介绍可以看这里,caffe环境配置过程可以参考这里,我在搭建环境时搜集了许多资料,这里整理了一下,介绍一下caffe在无CUDA的环境下如何配置. 1. 安 ...

  10. Python【基础第二篇】

    元组 元组的元素不可修改 元组的元素的元素可修改 字典 Python主文件判断 name == main python中一切事物都是对象 对象是基于类创建的 对象具有的所有功能都是从类里找的 int内 ...