当服务器有外网环境或者有yum源仓库的时候,安装软件依赖是非常方便的。当没有外网环境的时候,依赖的查找就显得非常痛苦。
解决方案,使用yum命令来下载依赖的rpm包。
1.配置yum配置缓存rpm包,yum配置文件/etc/yum.conf。
原内容如下:
[root@localhost ~]# cat /etc/yum.conf | grep -v "^#"
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0 # 缓存是否保存,1保存,0不保存
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
新内容如下:
[root@localhost ~]# cat /etc/yum.conf | grep -v "^#"
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=1 # 缓存是否保存,1保存,0不保存
debugle