1、复制 准备好的rpm包复制到指定目录
cp /abc/* /var/ftp/pub/rh6/
2、配置yum 客户端
# cat rh.repo
[rh-server]
name=rh6 server
baseurl=ftp://127.0.0.1/pub/rh6
enabled=1
gpgcheck=0
3、安装软件包(提供createrepo命令)
# rpm -ivh createrepo-0.9.9-17.el6.noarch.rpm
依赖于:
# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
4、生成目录/repodata 并且生成rpm包依赖关系文件
# createrepo -v /var/ftp/pub/rh6/
# ls /var/ftp/pub/rh6/repodata/
# 使用本地yum源自动解除依赖关系。
yum localinstall xxxx-xxx.rpm
perl_yum
[EMOS-base]
name=EMOS-Base
baseurl=http://mirror.extmail.org/yum/emos/1.5/os/$basearch/
gpgcheck=0
priority=0
protect=0
[EMOS-update]
name=EMOS-Updates
baseurl=http://mirror.extmail.org/yum/emos/1.5/updates/$basearch/
gpgcheck=0
priority=0
protect=0
download rpm
# cat /etc/yum.conf | grep keepcache
keepcache=1
# cat /etc/yum.conf | grep cachedir
cachedir=/var/cache/yum/$basearch/$releasever
# yum -y install telnet
# ll /var/cache/yum/x86_64/6/base/packages/
# yum install yum-fastestmirror
yum-fastestmirror :自动为你查找一个相对快的yum 源。
只下载 rpm 不安装:
# yum -y install yum-downloadonly
# yum install redis -y --downloadonly --downloaddir=/home
# ll /home/redis-2.4.10-1.el6.x86_64.rpm
转载于:https://blog.51cto.com/8824130/1429614