[Turn] [Linux] using yum

Linux system yum command to see which packages are installed: 
$ yum List Installed // list all installed packages 
yum package operations for frequently used commands: 
1. Use YUM to find package 
command: yum Search 
2. List all package installable 
command: yum List 
3. List all updated package 
commands: yum List updates 
4. List all installed packages 
command: yum List installed 
5. the installed but not list all yum Repository packages in the 
command: yum List Extras 
6. the package lists specified 
command: yum List 
7. the use yUM acquiring package information 
command: yum info 
8. the package list all information 
command: yum info 
9. the column all updatable package information 
command: yum info updates 
10. the list of all installed package information 
command: yum info installed 
11. the information in the list all packages are not installed but yum Repository 
command: yum info extras 
12. Listing packages which provide file 
Command: yum provides

 

Yum: That Yellowdog Update Modifier, is based on rpm package management tool

yum command example

Display yum warehouse

Show all warehouse

yum repolist all

Displays available warehouse

repolist enabled

Displays available warehouse

repolist disabled

Display application package

Show all packages

yum list 
yum list all

[vathe@localhost ~]$yum list tre?
Installed Packages
tree.x86_64                                         1.6.0-10.el7                                          @base

还支持通配符格式的查询

Display package installable

yum list available

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

Display can be updated or installed package

yum list updates

yum list installed

Display warehouse recently added packages

yum list recent

Installation package

#安装 tree 程序
yum install tree

Upgrade Package

yum update tree

Uninstall Packages

yum remove tree
yum erase tree

View package information

yum info tree

View the source file

View a file from the package

[vathe@localhost ~]$yum provides /bin/mv 
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程序包

Clean up local cache

yum clean all 

#清楚插件缓存
yum clean plugins

Build the cache

yum makecache

search for

[vathe@localhost ~]$yum search php
============================================== N/S matched: php ===============================================
graphviz-php.x86_64 : PHP extension for graphviz
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
...

Check the specified package depends capabilities

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

View Transaction History yum

[root@localhost ~]# yum history
Repository 'base' is missing name in configuration, using id
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

Package set of related commands

yum groupinstall    # 安装包组

yum groupupdate     #更新包组

yum grouplist       #显示包组

yum groupremove     #移除包组

yum groupinfo       #查看包组信息

这些命令和上面的命令用法类似,只是针对于包组而言

Guess you like

Origin blog.csdn.net/kingdelee/article/details/83450092