Linux yum 命令
Linux yum 命令
yum( Yellow dog Updater, Modified)是一个在 Fedora 和 RedHat 以及 SUSE 中的 Shell 前端软件包管理器。
基于 RPM 包管理,能够从指定的服务器自动下载 RPM 包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装。
yum 提供了查找、安装、删除某一个、一组甚至全部软件包的命令,而且命令简洁而又好记。
yum 语法
yum [options] [command] [package ...]
- options:可选,选项包括-h(帮助),-y(当安装过程提示选择全部为 "yes"),-q(不显示安装的过程)等等。
- command:要进行的操作。
- package:安装的包名。
yum常用命令
-
1. 列出所有可更新的软件清单命令:yum check-update
-
2. 更新所有软件命令:yum update
-
3. 仅安装指定的软件命令:yum install
-
4. 仅更新指定的软件命令:yum update
-
5. 列出所有可安裝的软件清单命令:yum list
-
6. 删除软件包命令:yum remove
-
7. 查找软件包命令:yum search
-
8. 清除缓存命令:
- yum clean packages: 清除缓存目录下的软件包
- yum clean headers: 清除缓存目录下的 headers
- yum clean oldheaders: 清除缓存目录下旧的 headers
- yum clean, yum clean all (= yum clean packages; yum clean oldheaders) :清除缓存目录下的软件包及旧的 headers
实例 1
安装 pam-devel
https://avg.163.com/topic/detail/9964854
https://avg.163.com/topic/detail/9965068
https://avg.163.com/topic/detail/9965067
https://avg.163.com/topic/detail/9964740
https://avg.163.com/topic/detail/9965046
https://avg.163.com/topic/detail/9965020
https://avg.163.com/topic/detail/9964806
https://avg.163.com/topic/detail/9965004
https://avg.163.com/topic/detail/9965006
https://avg.163.com/topic/detail/9964729
https://avg.163.com/topic/detail/9964953
https://avg.163.com/topic/detail/9964952
https://avg.163.com/topic/detail/9964951
https://avg.163.com/topic/detail/9964949
https://avg.163.com/topic/detail/9964948
https://avg.163.com/topic/detail/9964869
https://avg.163.com/topic/detail/9964917
https://avg.163.com/topic/detail/9964909
https://avg.163.com/topic/detail/9964908
https://avg.163.com/topic/detail/9964740
https://avg.163.com/topic/detail/9964858
https://avg.163.com/topic/detail/9964856
https://avg.163.com/topic/detail/9964855
https://avg.163.com/topic/detail/9964854
https://avg.163.com/topic/detail/9964849
https://avg.163.com/topic/detail/9964819
https://avg.163.com/topic/detail/9964806
https://avg.163.com/topic/detail/9964580
https://avg.163.com/topic/detail/9964579
https://avg.163.com/topic/detail/9964747
https://avg.163.com/topic/detail/9964746
https://avg.163.com/topic/detail/9964729
https://avg.163.com/topic/detail/9964740
https://avg.163.com/topic/detail/9964710
https://avg.163.com/topic/detail/9964709
https://avg.163.com/topic/detail/9964705
https://avg.163.com/topic/detail/9964667
https://avg.163.com/topic/detail/9964664
https://avg.163.com/topic/detail/9964656
https://avg.163.com/topic/detail/9964625
https://avg.163.com/topic/detail/9964624
https://avg.163.com/topic/detail/9964623
https://avg.163.com/topic/detail/9964622
https://avg.163.com/topic/detail/9964621
https://avg.163.com/topic/detail/9964580
https://avg.163.com/topic/detail/9964579
https://avg.163.com/topic/detail/9964578
https://avg.163.com/topic/detail/9964577
https://avg.163.com/topic/detail/9964538
https://avg.163.com/topic/detail/9964536
https://avg.163.com/topic/detail/9964535
https://avg.163.com/topic/detail/9964533
https://avg.163.com/topic/detail/9964532
https://avg.163.com/topic/detail/9964523
https://avg.163.com/topic/detail/9964491
https://avg.163.com/topic/detail/9964479
https://avg.163.com/topic/detail/9964189
https://avg.163.com/topic/detail/9964469
https://avg.163.com/topic/detail/9964221
https://avg.163.com/topic/detail/9964421
https://avg.163.com/topic/detail/9964420
https://avg.163.com/topic/detail/9964414
https://avg.163.com/topic/detail/9964413
https://avg.163.com/topic/detail/9964412
https://avg.163.com/topic/detail/9964383
https://avg.163.com/topic/detail/9964364
https://avg.163.com/topic/detail/9964360
https://avg.163.com/topic/detail/9964343
https://avg.163.com/topic/detail/9964330
https://avg.163.com/topic/detail/9964320
https://avg.163.com/topic/detail/9964314
https://avg.163.com/topic/detail/9964301
https://avg.163.com/topic/detail/9964285
https://avg.163.com/topic/detail/9964281
https://avg.163.com/topic/detail/9964275
https://avg.163.com/topic/detail/9964273
https://avg.163.com/topic/detail/9964242
https://avg.163.com/topic/detail/9964239
https://avg.163.com/topic/detail/9964177
https://avg.163.com/topic/detail/9964221
https://avg.163.com/topic/detail/9964198
https://avg.163.com/topic/detail/9964193
https://avg.163.com/topic/detail/9964190
https://avg.163.com/topic/detail/9964189
https://avg.163.com/topic/detail/9964188
https://avg.163.com/topic/detail/9964187
https://avg.163.com/topic/detail/9964139
https://avg.163.com/topic/detail/9964123
https://avg.163.com/topic/detail/9964101
https://avg.163.com/topic/detail/9963836
https://avg.163.com/topic/detail/9964072
https://avg.163.com/topic/detail/9964071
https://avg.163.com/topic/detail/9964070
https://avg.163.com/topic/detail/9964022
https://avg.163.com/topic/detail/9964042
https://avg.163.com/topic/detail/9964039
https://avg.163.com/topic/detail/9963995
https://avg.163.com/topic/detail/9963965
https://avg.163.com/topic/detail/9963953
https://avg.163.com/topic/detail/9963952
https://avg.163.com/topic/detail/9963947
https://avg.163.com/topic/detail/9963909
https://avg.163.com/topic/detail/9963920
https://avg.163.com/topic/detail/9963928
https://avg.163.com/topic/detail/9963900
https://avg.163.com/topic/detail/9963857
https://avg.163.com/topic/detail/9963855
https://avg.163.com/topic/detail/9963856
https://avg.163.com/topic/detail/9963854
https://avg.163.com/topic/detail/9963841
https://avg.163.com/topic/detail/9963839
https://avg.163.com/topic/detail/9963840
https://avg.163.com/topic/detail/9963823
https://avg.163.com/topic/detail/9963838
https://avg.163.com/topic/detail/9963837
https://avg.163.com/topic/detail/9963836
https://avg.163.com/topic/detail/9963824
https://avg.163.com/topic/detail/9963825
https://avg.163.com/topic/detail/9963809
https://avg.163.com/topic/detail/9963822
https://avg.163.com/topic/detail/9963820
https://avg.163.com/topic/detail/9963810
https://avg.163.com/topic/detail/9963808
https://avg.163.com/topic/detail/9963807
https://avg.163.com/topic/detail/9963806
https://avg.163.com/topic/detail/9963805
https://avg.163.com/topic/detail/9963790
https://avg.163.com/topic/detail/9963756
https://avg.163.com/topic/detail/9963791
https://avg.163.com/topic/detail/9963789
https://avg.163.com/topic/detail/9963774
https://avg.163.com/topic/detail/9963779
https://avg.163.com/topic/detail/9963770
https://avg.163.com/topic/detail/9963771
https://avg.163.com/topic/detail/9963767
https://avg.163.com/topic/detail/9963766
https://avg.163.com/topic/detail/9963765
https://avg.163.com/topic/detail/9963764
https://avg.163.com/topic/detail/9963763
https://avg.163.com/topic/detail/9963762
https://avg.163.com/topic/detail/9963761
https://avg.163.com/topic/detail/9963759
https://avg.163.com/topic/detail/9963760
https://avg.163.com/topic/detail/9963758
https://avg.163.com/topic/detail/9963756
https://avg.163.com/topic/detail/9963757
https://avg.163.com/topic/detail/9963207
https://avg.163.com/topic/detail/9963754
https://avg.163.com/topic/detail/9963744
https://avg.163.com/topic/detail/9963714
https://avg.163.com/topic/detail/9963706
https://avg.163.com/topic/detail/9963692
https://avg.163.com/topic/detail/9963683
https://avg.163.com/topic/detail/9963654
https://avg.163.com/topic/detail/9963623
https://avg.163.com/topic/detail/9963580
https://avg.163.com/topic/detail/9963451
https://avg.163.com/topic/detail/9963447
https://avg.163.com/topic/detail/9963386
https://avg.163.com/topic/detail/9963368
https://avg.163.com/topic/detail/9963365
https://avg.163.com/topic/detail/9963355
https://avg.163.com/topic/detail/9963360
https://avg.163.com/topic/detail/9963354
https://avg.163.com/topic/detail/9962713
https://avg.163.com/topic/detail/9963207
https://avg.163.com/topic/detail/9963110
https://avg.163.com/topic/detail/9963064
https://avg.163.com/topic/detail/9963035
https://avg.163.com/topic/detail/9963031
https://avg.163.com/topic/detail/9963029
https://avg.163.com/topic/detail/9963003
https://avg.163.com/topic/detail/9962696
https://avg.163.com/topic/detail/9962699
https://avg.163.com/topic/detail/9962906
https://avg.163.com/topic/detail/9962950
https://avg.163.com/topic/detail/9962875
https://avg.163.com/topic/detail/9962783
https://avg.163.com/topic/detail/9962753
https://avg.163.com/topic/detail/9962662
https://avg.163.com/topic/detail/9962754
https://avg.163.com/topic/detail/9962661
https://avg.163.com/topic/detail/9962657
https://avg.163.com/topic/detail/9962715
https://avg.163.com/topic/detail/9962713
https://avg.163.com/topic/detail/9962702
https://avg.163.com/topic/detail/9962701
https://avg.163.com/topic/detail/9962700
https://avg.163.com/topic/detail/9962699
https://avg.163.com/topic/detail/9962698
https://avg.163.com/topic/detail/9962697
https://avg.163.com/topic/detail/9962696
https://avg.163.com/topic/detail/9962694
https://avg.163.com/topic/detail/9962686
https://avg.163.com/topic/detail/9962677
https://avg.163.com/topic/detail/9962664
https://avg.163.com/topic/detail/9962663
https://avg.163.com/topic/detail/9962662
https://avg.163.com/topic/detail/9962661
https://avg.163.com/topic/detail/9962657
https://avg.163.com/topic/detail/9962660
https://avg.163.com/topic/detail/9962658
https://avg.163.com/topic/detail/9962656
https://avg.163.com/topic/detail/9962659
https://avg.163.com/topic/detail/9962644
https://avg.163.com/topic/detail/9962643
https://avg.163.com/topic/detail/9962642
https://avg.163.com/topic/detail/9962631
https://avg.163.com/topic/detail/9962630
https://avg.163.com/topic/detail/9962629
https://avg.163.com/topic/detail/9962623
https://avg.163.com/topic/detail/9962605
https://avg.163.com/topic/detail/9962587
https://avg.163.com/topic/detail/9962582
https://avg.163.com/topic/detail/9962529
https://avg.163.com/topic/detail/9962436
https://avg.163.com/topic/detail/9962443
https://avg.163.com/topic/detail/9962331
https://avg.163.com/topic/detail/9962318
https://avg.163.com/topic/detail/9962314
https://avg.163.com/topic/detail/9962309
https://avg.163.com/topic/detail/9962307
https://avg.163.com/topic/detail/9961635
https://avg.163.com/topic/detail/9961522
https://avg.163.com/topic/detail/9962143
https://avg.163.com/topic/detail/9962096
https://avg.163.com/topic/detail/9962083
https://avg.163.com/topic/detail/9961967
https://avg.163.com/topic/detail/9961954
https://avg.163.com/topic/detail/9961955
https://avg.163.com/topic/detail/9961919
https://avg.163.com/topic/detail/9961476
https://avg.163.com/topic/detail/9961880
https://avg.163.com/topic/detail/9961868
https://avg.163.com/topic/detail/9961798
https://avg.163.com/topic/detail/9961791
https://avg.163.com/topic/detail/9961416
https://avg.163.com/topic/detail/9961569
https://avg.163.com/topic/detail/9961642
https://avg.163.com/topic/detail/9961635
https://avg.163.com/topic/detail/9961621
https://avg.163.com/topic/detail/9961625
https://avg.163.com/topic/detail/9961534
https://avg.163.com/topic/detail/9961524
https://avg.163.com/topic/detail/9961523
https://avg.163.com/topic/detail/9961522
https://avg.163.com/topic/detail/9961521
https://avg.163.com/topic/detail/9961506
https://avg.163.com/topic/detail/9961505
https://avg.163.com/topic/detail/9961504
https://avg.163.com/topic/detail/9961503
https://avg.163.com/topic/detail/9961476
https://avg.163.com/topic/detail/9961471
https://avg.163.com/topic/detail/9961472
https://avg.163.com/topic/detail/9961470
https://avg.163.com/topic/detail/9961469
https://avg.163.com/topic/detail/9961467
https://avg.163.com/topic/detail/9961416
https://avg.163.com/topic/detail/9961337
https://avg.163.com/topic/detail/9961326
https://avg.163.com/topic/detail/9961324
https://avg.163.com/topic/detail/9961305
https://avg.163.com/topic/detail/9961285
https://avg.163.com/topic/detail/9961256
https://avg.163.com/topic/detail/9961157
https://avg.163.com/topic/detail/9961108
https://avg.163.com/topic/detail/9961049
https://avg.163.com/topic/detail/9960099
https://avg.163.com/topic/detail/9961016
https://avg.163.com/topic/detail/9960957
https://avg.163.com/topic/detail/9960953
https://avg.163.com/topic/detail/9960834
https://avg.163.com/topic/detail/9960257
https://avg.163.com/topic/detail/9960776
https://avg.163.com/topic/detail/9960775
https://avg.163.com/topic/detail/9960703
https://avg.163.com/topic/detail/9960613
https://avg.163.com/topic/detail/9960611
https://avg.163.com/topic/detail/9960510
https://avg.163.com/topic/detail/9960505
https://avg.163.com/topic/detail/9960479
https://avg.163.com/topic/detail/9960184
https://avg.163.com/topic/detail/9960473
https://avg.163.com/topic/detail/9960412
https://avg.163.com/topic/detail/9960302
https://avg.163.com/topic/detail/9960267
https://avg.163.com/topic/detail/9960279
https://avg.163.com/topic/detail/9960259
https://avg.163.com/topic/detail/9960258
https://avg.163.com/topic/detail/9960257
https://avg.163.com/topic/detail/9960254
https://avg.163.com/topic/detail/9960237
https://avg.163.com/topic/detail/9960184
https://avg.163.com/topic/detail/9960171
https://avg.163.com/topic/detail/9960132
https://avg.163.com/topic/detail/9960118
https://avg.163.com/topic/detail/9960108
https://avg.163.com/topic/detail/9960106
https://avg.163.com/topic/detail/9960102
https://avg.163.com/topic/detail/9960101
https://avg.163.com/topic/detail/9960099
https://avg.163.com/topic/detail/9960097
[root@www ~]# yum install pam-devel Setting up Install Process Parsing package install arguments Resolving Dependencies <==先检查软件的属性相依问题 --> Running transaction check ---> Package pam-devel.i386 0:0.99.6.2-4.el5 set to be updated --> Processing Dependency: pam = 0.99.6.2-4.el5 for package: pam-devel --> Running transaction check ---> Package pam.i386 0:0.99.6.2-4.el5 set to be updated filelists.xml.gz 100% |=========================| 1.6 MB 00:05 filelists.xml.gz 100% |=========================| 138 kB 00:00 -> Finished Dependency Resolution ……(省略)
实例 2
移除 pam-devel
[root@www ~]# yum remove pam-devel Setting up Remove Process Resolving Dependencies <==同样的,先解决属性相依的问题 --> Running transaction check ---> Package pam-devel.i386 0:0.99.6.2-4.el5 set to be erased --> Finished Dependency Resolution Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Removing: pam-devel i386 0.99.6.2-4.el5 installed 495 k Transaction Summary ============================================================================= Install 0 Package(s) Update 0 Package(s) Remove 1 Package(s) <==还好,并没有属性相依的问题,单纯移除一个软件 Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Erasing : pam-devel ######################### [1/1] Removed: pam-devel.i386 0:0.99.6.2-4.el5 Complete!
实例 3
利用 yum 的功能,找出以 pam 为开头的软件名称有哪些?
[root@www ~]# yum list pam* Installed Packages pam.i386 0.99.6.2-3.27.el5 installed pam_ccreds.i386 3-5 installed pam_krb5.i386 2.2.14-1 installed pam_passwdqc.i386 1.0.2-1.2.2 installed pam_pkcs11.i386 0.5.3-23 installed pam_smb.i386 1.1.7-7.2.1 installed Available Packages <==底下则是『可升级』的或『未安装』的 pam.i386 0.99.6.2-4.el5 base pam-devel.i386 0.99.6.2-4.el5 base pam_krb5.i386 2.2.14-10 base
国内 yum 源
网易(163)yum 源是国内较好的 yum 源之一 ,无论是速度还是软件版本,都非常的不错。
将yum源设置为163 yum,可以提升软件包安装和更新的速度,同时避免一些常见软件版本无法找到。
安装步骤
首先备份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载对应版本 repo 文件, 放入 /etc/yum.repos.d/ (操作前请做好相应备份)
- CentOS5 :http://mirrors.163.com/.help/CentOS5-Base-163.repo
- CentOS6 :http://mirrors.163.com/.help/CentOS6-Base-163.repo
- CentOS7 :http://mirrors.163.com/.help/CentOS7-Base-163.repo
本文地址:https://www.yitenyun.com/5136.html









