由于公司数据库没有外网,通过yum设置内网源达到更新。
1.安装httpd和createrepo
yum install httpd createrepo
2.修改httpd
cd /etc/httpd/conf
修改apache配置
ServerName 10.241.47.200:8092 内网ip
3.先下载centos镜像
地址:http://mirrors.163.com/centos/6/isos/x86_64/
4.服务端设置yum软件仓库
mkdir /mnt
将iso镜像文件上传到/data_disk/iso文件夹下
mount -o loop /data_disk/iso/xx.iso /mnt/
df -h
cp -r /mnt/* /var/www/html/yum/CentOS
umount /mnt
5.客户端设置
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.bak
vim CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://1.1.1.1:8092/yum/CentOS/ 内网ip,否则会更新失败
enabled=1
gpgcheck=0
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://1.1.1.1:8092/yum/CentOS/
enabled=1
gpgcheck=0
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://1.1.1.1:8092/yum/CentOS/
enabled=1
gpgcheck=0
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
6.测试
yum install mc