准备大量RPM软件包
−Red Hat发布的RPM包集合
−第三方、用户自定义的RPM包集合
以哪种方式提供给客户机
−本地目录:file://...
−FTP或HTTP服务:ftp://...、http://...
直接访问RHEL6光盘目录
−以触发挂载点/misc/cd/ 为例,只需插入光盘
−提供给本机作为YUM软件源
主要文件
−基本设置:/etc/yum.conf
−仓库配置:/etc/yum.repos.d/*.repo
−日志文件:/var/log/yum.log
- [root@hadoop ~]# cat /etc/yum.conf
- [main]
- cachedir=/var/cache/yum/$basearch/$releasever
- keepcache=0 //软件装完以后不保留缓存的rpm文件
- debuglevel=2
- logfile=/var/log/yum.log //日志文件
- exactarch=1
- obsoletes=1
- gpgcheck=1 //检查软件包的签名
.repo 基本配置项
−[源名称] :自定义名称,具有唯一性
−name:本软件源的描述字串
−baseurl:指定YUM服务端的URL地址
−enabled:是否启用此频道
−gpgcheck:是否验证待安装的RPM包文件
−gpgkey:用于RPM验证的密钥文件
创建rhel6.repo配置文件
−可用的软件源位于本机/misc/cd/ 目录
列出可用的YUM仓库
−关注软件数量
- [root@hadoop ~]# yum repolist
- base | 3.7 kB 00:00
- extras | 3.4 kB 00:00
- updates | 3.4 kB 00:00
- repo id repo name status
- base CentOS-6.10 - Base - mirrors.aliyun.com 6,713
- extras CentOS-6.10 - Extras - mirrors.aliyun.com 47
- updates CentOS-6.10 - Updates - mirrors.aliyun.com 1,193
基本操作
−用法:yum list[软件名]...
yum list installed|availabel
[root@hadoop ~]# yum list
基本操作
−用法:yum search关键词
yum info [软件名]...
yum provides 文档路径...
- [root@hadoop ~]# yum search httpd //通过关键词httpd查找软件
- [root@hadoop ~]# yum info httpd //查看软件包httpd的描述
- [root@hadoop ~]# yum provides /etc/passwd //查看哪些软件能提供
移除指定软件,类似于rpm -e
−用法:yum [-y] remove[软件名]...
安装指定软件,类似于rpm -i
−用法:yum [-y] install[软件名]...
升级指定软件,类似于rpm -U
−用法:yum [-y] update[软件名]...
重装指定软件,类似于rpm -i--force
−用法:yum [-y] reinstall[软件名]...
基本操作
−用法:yum grouplist[软件组名]...
yum groupinfo软件组名...
- [root@hadoop ~]# yum grouplist
- [root@hadoop ~]# yum groupinfo
基本操作
−用法:yum [-y] 指令[软件组名]...
主要指令
−groupinstall:安装指定的软件组
−groupupdate:升级软件组
−groupremove:卸载软件组
快速安装开发环境
−提供gcc编译器、make连接工具等
−安装“开发工具”或者“Development Tools”软件组
存放位置:/var/cache/yum/
- [root@hadoop ~]# grep cache /etc/yum.conf
- cachedir=/var/cache/yum/$basearch/$releasever
- keepcache=0 //不保留下载的RPM文件
-
排除缓存异常的故障
−清空缓存、再次查询或更新时,会自动重建
[root@hadoop ~]# yum clean all
用法:yumdownloader[选项]... 软件名...
−--urls,查看指定软件的仓库地址
−--resolve,分析依赖关系,将需要的软件包也一起下载
适用的场合
−主软件的RPM文件已下载到本地
−需要利用YUM源来解决必要的软件依赖关系