yum( Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器。html
基於RPM包管理,可以从指定的服务器自动下载RPM包而且安装,能够自动处理依赖性关系,而且一次安装全部依赖的软体包,无须繁琐地一次次下载、安装。前端
yum提供了查找、安装、删除某一个、一组甚至所有软件包的命令,并且命令简洁而又好记。linux
yum [options] [command] [package ...]
安装 pam-develcentos
[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源之一 ,不管是速度仍是软件版本,都很是的不错。this
将yum源设置为163 yum,能够提高软件包安装和更新的速度,同时避免一些常见软件版本没法找到。spa
首先备份/etc/yum.repos.d/CentOS-Base.repodebug
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载对应版本 repo 文件, 放入 /etc/yum.repos.d/ (操做前请作好相应备份)code
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo mv CentOS6-Base-163.repo CentOS-Base.repo
运行如下命令生成缓存
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
转载自: