yum命令的使用

来源:互联网 发布:js面向对象实现过程 编辑:程序博客网 时间:2024/06/05 00:15

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


[root@serv01 ~]# yum --helpLoaded plugins: product-id, subscription-managerUpdating Red Hat repositories.Usage: yum [options] COMMANDList of Commands:check          Check for problems in the rpmdbcheck-update   Check for available package updatesclean          Remove cached datadeplist        List a package's dependenciesdistribution-synchronization Synchronize installed packages to the latest available versionsdowngrade      downgrade a packageerase          Remove a package or packages from your systemgroupinfo      Display details about a package groupgroupinstall   Install the packages in a group on your systemgrouplist      List available package groupsgroupremove    Remove the packages in a group from your systemhelp           Display a helpful usage messagehistory        Display, or use, the transaction historyinfo           Display details about a package or group of packagesinstall        Install a package or packages on your systemlist           List a package or groups of packagesload-transaction load a saved transaction from filenamemakecache      Generate the metadata cacheprovides       Find what package provides the given valuereinstall      reinstall a packagerepolist       Display the configured software repositoriesresolvedep     Determine which package provides the given dependencysearch         Search package details for the given stringshell          Run an interactive yum shellupdate         Update a package or packages on your systemupgrade        Update packages taking obsoletes into accountversion        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 httpdhttpd-tools-2.2.15-9.el6.x86_64httpd-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 -yLoaded plugins: product-id, subscription-managerUpdating Red Hat repositories.Setting up Install ProcessPackage httpd-2.2.15-9.el6.x86_64 already installed and latest versionNothing to do#使用reinstall重装[root@serv01 ~]# yum reinstall httpd -yInstalled:  httpd.x86_64 0:2.2.15-9.el6                                                                                                         Complete!#查询所有[root@serv01 ~]# yum list#可以安装的略#查询httpd,有@表示已经安装[root@serv01 ~]# yum list|grep httpdhttpd.x86_64                          2.2.15-9.el6                     @rhel-isohttpd-tools.x86_64                    2.2.15-9.el6                     @rhel-isohttpd-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 httpdhttpd-tools-2.2.15-9.el6.x86_64httpd-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" -yInstalled:  emacs.x86_64 1:23.1-21.el6                                                                                                          Complete![root@serv01 ~]# yum groupremove "Emacs" -yRemoved:  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


katoonSina CSDN@Wentasy 博文仅供参考,欢迎大家来访。如有错误之处,希望批评指正。原创博文如需转载请注明出处,谢谢 :) [CSDN博客]
原创粉丝点击