yum( Yellow dog Updater, Modified)是一個在Fedora和RedHat以及SUSE中的Shell前端軟件包管理器。
基於RPM包管理,能夠從指定的服務器自動下載RPM包並且安裝,可以自動處理依賴性關系,並且一次安裝所有依賴的軟體包,無須繁瑣地一次次下載、安裝。
yum提供了查找、安裝、刪除某一個、一組甚至全部軟件包的命令,而且命令簡潔而又好記。
yum [options] [command] [package ...]
安裝 pam-devel
[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 ……(省略)
移除 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!
利用 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
網易(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/(操作前請做好相應備份)
運行以下命令生成緩存
yum clean all yum makecache
除了網易之外,國內還有其他不錯的yum源,比如中科大和搜狐。
中科大的yum源,安裝方法查看:https://lug.ustc.edu.cn/wiki/mirrors/help/centos
sohu的yum源安裝方法查看: http://mirrors.sohu.com/help/centos.html