mkdir -p /application/yum/centos6.7/x86_64/
cd /application/yum/centos6.7/x86_64/
rz # 上传rpm包到此目录,此目录下面还可以包括文件夹(也可自制rpm包)
yum -y install createrepo
createrepo -pdo /application/yum/centos6.7/x86_64//application/yum/centos6.7/x86_64/
# 可以用Apache或nginx提供web服务,但用Python的http模块更简单,适用于内网环境
cd /application/yum/centos6.7/x86_64/
python -m SimpleHTTPServer 80 &>/dev/null&
# 只下载软件不安装
yumdownloader pcre-devel openssl-devel
createrepo --update/application/yum/centos6.6/x86_64/
# 每加入一个rpm包就要更新一下。
平时yum安装软件时不删除安装包
vim /etc/yum.conf
keepcache=1
mount /dev/cdrom /mnt
cd /etc/yum.repos.d/
mkdir test
ls *.repo|xargs -i mv {} test
cat >>CentOS-Base.repo<<EOF
[oldboy]
name=Server
baseurl=http://10.0.0.127 yum服务器的IP地址
enable=1
gpgcheck=0
EOF
[root@moban6 yum.repos.d]# yum --enablerepo=oldboy--disablerepo=base,extras,updates,epel list
[root@moban6 yum.repos.d]# yum install -y zsh
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package zsh.x86_64 0:4.3.11-4.el6.centoswill be installed
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================================
Package Arch Version Repository Size
=======================================================================================================
Installing:
zsh x86_64 4.3.11-4.el6.centos oldboy 2.2 M
Transaction Summary
=======================================================================================================
Install 1 Package(s)
Total download size: 2.2 M
Installed size: 5.0 M
Downloading Packages:
zsh-4.3.11-4.el6.centos.x86_64.rpm |2.2 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: zsh-4.3.11-4.el6.centos.x86_64 1/1
Verifying :zsh-4.3.11-4.el6.centos.x86_64 1/1
Installed:
zsh.x86_640:4.3.11-4.el6.centos
Complete!