yum源配置
1 修改CentOS默认yum源为mirrors.163.com
(1)首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
(2)cd到 /etc/yum.repos.d/目录 下,开始跟新yum源。
CentOS7:wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
CentOS6:wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
(3)运行yum makecache生成缓存
yum makecache 或者 yum repolist 或者yum update -y
2 修改CentOS默认yum源为mirrors.aliyun.com
(1)首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
(2)cd到 /etc/yum.repos.d/目录 下,开始跟新yum源。
CentOS7:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
CentOS6:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
centos系统
epel(RHEL 7)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
epel(RHEL 6)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
3 yum仓库服务器搭建
vim /etc/yum.repos.d/yum_server.repo
name=source_from_localserver #这里是整合到server端的centos6的光盘镜像yum源
baseurl=http://10.20.0.50/yum_server
enable=1
priority=1 #这里的priority就是上面安装的优先级工具,设定从小到大
4 本地离线仓库搭建
yum 仓库:
baseurl=file://
http://ip
离线仓库(自定义本地仓库)
1.创建本地仓库目录
mkdir /test
2.将下载好的*.rpm安装包拷贝到/test目录下面。
cp xxx.rpm /test
3.创建yum本地仓库
createrepo /test
4.配置yum本地离线仓库(vim /etc/yum.repos.d/xxx.repo)
...
baseurl=file:///test
...