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不同的 ...
随机推荐
- 表单Ext.form.FormPanel(转)
1.表单 对于传统的b/s应用来说,数据录入元素是放在表单<form>标签里面的.而对于ExtJS应用来说,则可以直接使用FormPanel控件来存放表单中的元素.FormPanel继承自 ...
- Auto Updating the exe from a network location when application starts z
http://www.codeproject.com/Tips/869588/Auto-Updating-the-exe-from-a-network-location-when?msg=499218 ...
- [转]inux之touch命令
转自:http://www.2cto.com/os/201309/242518.html Linux学习之touch命令 Linux的touch命令一般用来更改文档或目录的日期时间,包括存取时间和 ...
- stitch image app (Qt)
result how to use? source code http://7qnct6.com1.z0.glb.clouddn.com/dropSelect.rar
- bzoj3620 似乎在梦中见过的样子
好久没有写过KMP了,今天写个KMP练练手.此题就是枚举左端点暴力,用KMP做到O(n^2) #include<cstdio> #include<cstring> using ...
- python中隐式的内存共享
在python中,基本上使用的是引用,那么就会造成一个隐式的内存共享,特别是在容器对象中,例如list,dictionary 对于不可变对象,是不会造成隐式的内存共享情况,如下所示: >> ...
- linux中清除cache的方法
在进行测试文件导入的时候,发现内存占用很大,如下所示: [root@python ~]# vmstat 1 -S M 3 procs -----------memory---------- ---sw ...
- MVC的路由
MVC的路由包括以下几部分 路由名称,路由URL,路由的初始值,路由的约束,路由的命名空间 routes.MapRoute( name: "Default", url: " ...
- SpringMVC + Spring + MyBatis 学习笔记:提交数据遭遇基础类型和日期类型报400错误解决方法
系统:WIN8.1 数据库:Oracle 11GR2 开发工具:MyEclipse 8.6 框架:Spring3.2.9.SpringMVC3.2.9.MyBatis3.2.8 使用SpringMVC ...
- JavaScript面向对象(01)--函数
在JavaScript中,函数和对象有区别,也有联系, 首先函数是一个对象,但是和对象存在一些区别如下: 1,不论在java还是js中,如果把一个对象赋值给另一个变量,那么,后者会指向前者对象所在的内 ...
