yum command

1.yum command

yum is a package manager,

yum is a command to find, install, and remove a package, a group of packages, or even all packages.

Dependencies are handled automatically and all dependent packages are installed at once.


2. How to use the yum command

yum list //List available rpm packages

yum grouplist //List rpm package groups

yum install -y package name //install the specified package

yum groupinstall group name //install the specified package group

yum search keyword //Search package, not precise and comprehensive, the description contains keywords will also be listed.

yum remove package name //uninstall the specified package

yum update [package name] //Do not add the package name to upgrade all including the system, add the package name to upgrade the specified package

yum provides "/*/filename" //Search for which package the file came from.


3. Examples

3.1 yum installs a software

# yum install -y vim


3.2 View yum software list and search

List:

It can be filtered, and the @ symbol behind it indicates that it has been installed.

# yum list |grep vim

vim-common.x86_64                           2:7.4.160-2.el7            @base

vim-enhanced.x86_64                         2:7.4.160-2.el7            @base

vim-filesystem.x86_64                       2:7.4.160-2.el7            @base

vim-minimal.x86_64                          2:7.4.160-2.el7            @anaconda

protobuf-vim.x86_64                         2.5.0-8.el7                base

vim-X11.x86_64                              2:7.4.160-2.el7            base


search:

The search will also search for packages that contain keywords in their descriptions.

# yum search vim

protobuf-vim.x86_64 : Vim syntax highlighting for Google Protocol Buffers descriptions

vim-X11.x86_64 : The VIM version of the vi editor for the X Window System

vim-common.x86_64 : The common files needed by any version of the VIM editor


3.3 Which package should the search command install

If there is no wget command, the result of the search is that one is from the base source and the other is the update source upgrade. That is to say, you can directly yum install wget.

# yum provides "/*/wget"

wget-1.14-15.el7.x86_64 : A utility for retrieving files using the HTTP or FTP protocols

source : base

Match source:

filename: /usr/bin/wget


wget-1.14-15.el7_4.1.x86_64 : A utility for retrieving files using the HTTP or FTP protocols

source: updates

Match source:

filename: /usr/bin/wget


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324538272&siteId=291194637