centos6.0搭建本地yum源,网络源

centos6.0搭建本地yum源,网络源
本文讲解yum源的三个使用方法,可根据实际生产环境进行选择,建议有linux基础的同学学习,挂载镜像和服务安装启动这些不讲了,或者直接傻瓜式操作,直接粘贴复制也可以使用。
1.本地yum源:将本地的IOS镜像挂载在本地目录中,当作yum源。
2.服务器yum源:将某台服务器当作yum源,用于本地的服务安装和升级
注:有两种方法使用ftp时,需要将vsftpd服务启动,使用http时需要将httpd服务启动,关于linux的基础服务自己看书吧。
3.公网网络源(163、阿里云、等)使用公网资源当作本机的yum源,可根据服务器yum源配合使用(一台访问公网,其他访问这台)
本文整合了本地yum源和服务器地址的yum源以及阿里云的网络源,服务器IP根据实际生产环境自己更改

yum网络源地址:
163的网络源地址:
centos6.0的网络源地址:
http://mirrors.163.com/centos/6/os/x86_64/
centos7.0的网络源地址:
http://mirrors.163.com/centos/7/os/x86_64/

阿里云的网络源地址:
centos6.0的网络源地址:
http://mirrors.aliyun.com/repo/Centos-6.repo
centos7.0的网络源地址:
http://mirrors.aliyun.com/repo/Centos-7.repo
http://mirrors.aliyun.com/centos/6/os/x86_64/
2.下载新的repo 到/etc/yum.repos.d/
wget -O /etc/yum.repos.d/Centos-6.repo http://mirrors.aliyun.com/repo/Centos-6.repo
注:这一步下载下来的repo文件对于4年前不修改可以用,但对于目前需要更改地址才可以使用。

3.如下整合了本地yum源和服务器地址的yum源以及阿里云的网络源
[root@master yum.repos.d]# pwd
/etc/yum.repos.d
[root@master yum.repos.d]# cat CentOS-Base.repo
#linux系统本身的yum源地址
[base]
enable=0
name=aaa
baseurl=file:///mnt/server
gpgcheck=0

#将服务器10.1.1.10当作yum源地址
[pxe]
name=pxe
baseurl=http://10.1.1.10/kickstart
gpgcheck=0
#使用阿里云的yum源地址
[aliyun]
name=aliyun
baseurl=http://mirrors.aliyun.com/centos/6/os/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/6/updates/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/6/extras/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/6/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/6/contrib/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
4.

  • clean [ packages | metadata | expire-cache | rpmdb | plugins | all ]
    *makecache
    Clean:
    Is used to clean up various things which accumulate in the yum cache directory over time. More complete
    details can be found in the Clean Options section below.
    Makecache:
    Is used to download and make usable all the metadata for the currently enabled yum repos.
    使用命令:
    yum clean all
    yum makecache

centos6.0搭建本地yum源,网络源
5.配置完成后使用命令yum -y list 测试yum

centos6.0搭建本地yum源,网络源
整合后的yum源配置完成

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值