当前位置:   article > 正文

CentOS下yum命令详解

centos 中的yum命令

CentOS下yum命令详解

Yum: 即Yellowdog Update Modifier,是一种基于rpm的包管理工具

yum命令使用示例

显示yum仓库

显示所有仓库

yum repolist all

显示可用的仓库

repolist enabled

显示可用的仓库

repolist disabled

显示应用程序包

显示所有的程序包

  1. yum list
  2. yum list all
  3. [vathe@localhost ~]$yum list tre?
  4. Installed Packages
  5. tree.x86_64 1.6.0-10.el7 @base 还支持通配符格式的查询

显示可安装的程序包

  1. yum list available
  2. [vathe@localhost ~]$yum list available php
  3. Available Packages
  4. php.x86_64 5.4.16-42.el7 base

显示可更新或已安装的程序包

  1. yum list updates
  2. yum list installed

显示仓库中最近增加的程序包

yum list recent

安装程序包

  1. #安装 tree 程序
  2. yum install tree

升级程序包

yum update tree

卸载程序包

  1. yum remove tree
  2. yum erase tree

查看程序包信息

yum info tree

查看文件的来源

查看某一文件来自于那个程序包

  1. [vathe@localhost ~]$yum provides /bin/mv
  2. coreutils-8.22-18.el7.x86_64 : A set of basic GNU tools commonly used in shell scripts Repo : base Matched from: Filename : /bin/mv #表示/bin/mv文件来自于coreutils-8.22-18.el7.x86_64程序包

清理本地缓存

  1. yum clean all
  2. #清楚插件缓存
  3. yum clean plugins

构建缓存

yum makecache

搜索

  1. [vathe@localhost ~]$yum search php
  2. ============================================== N/S matched: php ===============================================
  3. graphviz-php.x86_64 : PHP extension for graphviz
  4. php.x86_64 : PHP scripting language for creating dynamic web sites php-bcmath.x86_64 : A module for PHP applications for using the bcmath library ...

查看指定包所依赖的capabilities

  1. [vathe@localhost ~]$yum deplist php
  2. package: php.x86_64 5.4.16-42.el7 dependency: httpd provider: httpd.x86_64 2.4.6-45.el7.centos ...

查看yum事务历史

  1. [root@localhost ~]# yum history
  2. Repository 'base' is missing name in configuration, using id
  3. ID | Login user | Date and time | Action(s) | Altered ------------------------------------------------------------------------------- 2 | Vathe Su <vathe> | 2017-04-17 17:07 | Install | 1 1 | System <unset> | 2017-03-23 22:19 | Install | 1405 history list

包组相关的命令

  1. yum groupinstall # 安装包组
  2. yum groupupdate #更新包组
  3. yum grouplist #显示包组
  4. yum groupremove #移除包组 yum groupinfo #查看包组信息 这些命令和上面的命令用法类似,只是针对于包组而言

转载于:https://www.cnblogs.com/vathe/p/6736094.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/823347
推荐阅读
相关标签
  

闽ICP备14008679号