yum命令的使用
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命令的使用的更多相关文章
- linux yum命令详解
yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...
- linux yum命令详解-转
yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...
- linux yum 命令
linux yum 命令 yum( Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器. 基於RPM包管理,能够从指 ...
- Linux系统yum命令安装软件时保留(下载)rpm包 -- 转载
昨天在部署zabbix监控的时候,遇到一个问题:监控服务器处于无外网状态,在线安装不可用.而某些依赖包度娘或谷姐搜索起来也挺呛人的!于是想到一个办法,利用有外网的服务器的yum命令来安装这些软件,并自 ...
- 【转】linux yum命令详解
yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...
- yum命令详解
yum(全 称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载 ...
- yum命令指南
yum check-update 检查可更新的所有软件包 yum update 下载更新系统已安装的所有软件包yum upgrade 大规模的版本升级,与yum update不同的是,连旧的淘汰 ...
- 最详细的Linux YUM命令使用教程
YUM(Yellow dog Updater, Modified)为多个Linux发行版的前端软件包管理器,例如 Redhat RHEL, CentOS & Fedora. YUM通过调用R ...
- 用于软件包管理的21个Linux YUM命令 转载
http://flycars001.iteye.com/blog/1949085 YUM到底是啥东东? YUM(Yellowdog Updater Modified)是一款开源命令行及图形化软件包管理 ...
- yum命令指南-yum使用方法
yum check-update 检查可更新的所有软件包 yum update 下载更新系统已安装的所有软件包 yum upgrade 大规模的版本升级,与yum update不同的 ...
随机推荐
- Android 一步步教你从ActionBar迁移到ToolBar
谷歌的材料设计也发布了有一段时间了,包括官方的support库 相信大家也熟悉了不少,今天就把actionbar 迁移到toolbar的 经验发出来. 这个地方要注意 我用的图标都是studio里的一 ...
- python tile函数用法
tile函数位于python模块 numpy.lib.shape_base中,他的功能是重复某个数组.比如tile(A,n),功能是将数组A重复n次,构成一个新的数组,我们还是使用具体的例子来说明问题 ...
- svn 安装与设置
Subversion可以通过网络访问它的版本库,从而使用户可以在不同的电脑上使用.一定程度上可以说,允许用户在各自的地方修改同一份数据是促进协作. 运行Subversion服务器需要首先要建立一个版本 ...
- ON、WHERE、HAVING的区别
ON .WHERE.HAVING都能通过限制条件筛选数据,但他们的使用及其不同.下面我们来分析三者之间的区别. 1. ON 和WHERE 所有的查询都回产生一个中间临时报表,查询结果就是从 ...
- 使GridView可以单行横向滑动
最近做的练手的小项目中存在一个横向滑动的问题,需要HorizontalScroll中嵌套GridView,但是GridView默认是竖直排放的item,况且HorizontalScroll与GridV ...
- app如何节省流量
前言:“客户端上传时间戳”的玩法,你玩过么?一起聊聊时间戳的奇技淫巧! 缘起:无线时代,流量敏感.APP在登录后,往往要向服务器同步非常多的数据,很费流量,技术上有没有节省流量的方法呢?这是本文要讨论 ...
- 先声明再定义的必要性 .xml
pre{ line-height:1; color:#9f1d66; background-color:#cfe4e4; font-size:16px;}.sysFunc{color:#5d57ff; ...
- springMVC框架访问web-inf下的jsp文件
博客原文章:http://td.xue163.com/1042/1/10425265.html 用户提出问题:springMVC框架访问web-inf下的jsp文件,具体如下: 使用springMVC ...
- STL map详细用法和make_pair函数
今天练习华为上机测试题,遇到了map的用法,看来博客http://blog.csdn.net/sprintfwater/article/details/8765034:感觉很详细,博主的其他内容也值得 ...
- 封装cookie.js、EventUtil.js、
最近学习了javascript,封装好的东西看起来舒服,以备需要的时候拉出来,jquery对javascript做了很好的封装!以后会多用jquery多些 var CookieUtil = { get ...
