Linux软件安装方式 - Tarball&RPM&YUM( 五 )

  • YUM 安装&升级
# 安装 pam-devel$ yum install pam-develLoaded plugins: fastestmirror # 首先的 5 行在找出最快的 yum serverLoading mirror speeds from cached hostfile * base: mirrors.ustc.edu.cn * extras: mirrors.aliyun.com * updates: mirrors.ustc.edu.cnResolving Dependencies# 接下来先处理依赖的软件问题--> Running transaction check---> Package pam-devel.x86_64 0:1.1.8-23.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved# 由上面的检查发现到 pam 这个软件也需要同步升级 , 这样才能够安装新版 pam-devel 喔!# 至于下面则是一个总结的表格显示!=============================================================================================================================== PackageArchVersionRepositorySize===============================================================================================================================Installing: pam-develx86_641.1.8-23.el7base185 kTransaction Summary===============================================================================================================================Install1 Package# 要安装软件数量是一个Total download size: 185 kInstalled size: 528 kIs this ok [y/d/N]: yDownloading packages:pam-devel-1.1.8-23.el7.x86_64.rpm| 185 kB00:00:00Running transaction checkRunning transaction testTransaction test succeededRunning transactionInstalling : pam-devel-1.1.8-23.el7.x86_641/1Verifying: pam-devel-1.1.8-23.el7.x86_641/1 Installed:pam-devel.x86_64 0:1.1.8-23.el7Complete!
  • YUM 移除
$ yum remove pam-develYUM 其他配置YUM 仓库配置# YUM 仓库配置文件查看$ vi /etc/yum.repos.d/CentOS-Base.repo[base]name=CentOS-$releasever - Basemirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#released updates[updates]name=CentOS-$releasever - Updatesmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that may be useful[extras]name=CentOS-$releasever - Extrasmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plusmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
参数详情:
  • name:只是说明一下这个软件库的意义而已 , 重要性不高!
  • mirrorlist=:列出这个软件库可以使用的映射站台 , 如果不想使用 , 可以注解到这行;
  • baseurl=:这个最重要 , 因为后面接的就是软件库的实际网址! mirrorlist 是由 yum 程序自行去捉映射站台 ,  baseurl 则是指定固定的一个软件库网址!我们刚刚找到的网址放到这里来啦!
  • enable=1:就是让这个软件库被启动 。如果不想启动可以使用 enable=0 喔!
  • gpgcheck=1:还记得 RPM 的数码签章吗?这就是指定是否需要查阅 RPM 文件内的数码签章!
  • gpgkey=:就是数码签章的公钥档所在位置!使用默认值即可
YUM 仓库查看&清除
  • 列出使用的软件库
$ yum repolist all# 上面最右边有写 enabled 才是有启动的;

经验总结扩展阅读