• 一、作用

基于 RPM 包管理,能够从指定的服务器自动下载 RPM 包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装

二、选项

    1. 列出所有可更新的软件清单命令:yum check-update
    1. 更新所有软件命令:yum update
    1. 仅安装指定的软件命令:yum install
    1. 仅更新指定的软件命令:yum update
    1. 列出所有可安裝的软件清单命令:yum list
    1. 删除软件包命令:yum remove
    1. 查找软件包命令:yum search
    1. 清除缓存命令:
      • yum clean packages: 清除缓存目录下的软件包
      • yum clean headers: 清除缓存目录下的 headers
      • yum clean oldheaders: 清除缓存目录下旧的 headers
      • yum clean, yum clean all 清除缓存目录下的软件包及旧的 headers
  • 9.生成缓存命令 : yum makecache
  • 查看yum源 :yum repolist
  • 查看yum软件包 : yum list

    yum源

    阿里云:
    https://mirrors.aliyun.com/repo/Centos-7.repo
    http://mirrors.aliyun.com/repo/epel-7.repo
    网易:
    http://mirrors.163.com/.help/CentOS7-Base-163.repo

    三、实例

    ```shell [root@localhost data]# yum search vim 已加载插件:fastestmirror Loading mirror speeds from cached hostfile
    • base: mirrors.aliyun.com
    • extras: mirrors.aliyun.com
    • updates: mirrors.aliyun.com =================================== N/S matched: vim =================================== beakerlib-vim-syntax.noarch : Files for syntax highlighting BeakerLib tests in VIM
      1. : editor
      boxes-vim.noarch : Vim plugin for boxes fluxbox-vim-syntax.noarch : Fluxbox syntax scripts for vim geany-plugins-vimode.x86_64 : Vim-mode plugin for Geany neovim.x86_64 : Vim-fork focused on extensibility and agility protobuf-vim.x86_64 : Vim syntax highlighting for Google Protocol Buffers descriptions python2-neovim.noarch : Python client to Neovim python36-neovim.noarch : Python client to Neovim vim-X11.x86_64 : The VIM version of the vi editor for the X Window System vim-ansible.noarch : Vim plugin for syntax highlighting ansible’s common filetypes vim-common.x86_64 : The common files needed by any version of the VIM editor vim-enhanced.x86_64 : A version of the VIM editor which includes recent enhancements vim-filesystem.x86_64 : VIM filesystem layout vim-go.x86_64 : Go development plugin for Vim vim-gtk-syntax.noarch : Vim syntax highlighting for GLib, Gtk+, Gstreamer, and more vim-jellybeans.noarch : A colorful, dark color scheme for Vim vim-minimal.x86_64 : A minimal version of the VIM editor vim-toml.noarch : Vim syntax for TOML vim-vimoutliner.noarch : Script for building an outline editor on top of Vim xtuple-csvimp-devel.x86_64 : CSVImp development files apvlv.x86_64 : PDF viewer which behaves like Vim vim-fugitive.noarch : A Git wrapper so awesome, it should be illegal vim-halibut.noarch : Syntax file for the halibut manual tool vim-trailing-whitespace.noarch : Highlights trailing whitespace in red and provides
                             : :FixWhitespace to fix it
      
      xtuple-csvimp.x86_64 : xTuple data import utility
```shell
[root@localhost ~]# yum install -y wget
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 To enable Red Hat Subscription Management repositories:
     subscription-manager repos --enable <repo>
 To enable custom repositories:
     yum-config-manager --enable <repo>   #已安装
[root@localhost ~]# yum clean all && yum makecache  #清楚缓存 重新建立缓存
yum repolist