Centos6配置yum源

Centos6的一些优势

Centos6的安装镜像仅400M,开机内存使用仅仅110M. 资源使用率极低,1G内存的机器就能跑的飞起.
在这里插入图片描述
JDK和Nginx都能正常运行,对一些硬件资源有限的项目,还挺适合的.
在这里插入图片描述


为Centos6配置CentOS Vault源—防止yum源过期

参考:https://mirrors.ustc.edu.cn/help/centos.html
CentOS 6系统于2020年11月30日停止维护服务,如有需要继续使用 CentOS6,请使用 CentOS Vault 镜像源。

mkdir -p /etc/yum.repos.d/bak

# 备份旧的源文件
mv /etc/yum.repos.d/*.bak /etc/yum.repos.d/bak

# 编辑
vi /etc/yum.repos.d/CentOS-Vault.repo

源内容如下:

[base]
name=CentOS-6.10 - Base - mirrors.aliyun.com
failovermethod=priority	
baseurl=https://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-6.10 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

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

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

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

结果验证

# 安装vim
yum install -y vim

在这里插入图片描述


为Centos6配置epel源

# 手动编辑epel.repo文件
vim /etc/yum.repos.d/epel.repo
# 阿里云的epel源
[epel-aliyun]
name=epel-aliyun-CentOS-$releasever
baseurl=https://mirrors.aliyun.com/epel-archive/$releasever/$basearch/
gpgcheck=0

结果验证

# 从epel源安装htop
yum install -y htop

在这里插入图片描述


为Centos6配置ELRepo源—已ELRepo被官方清空

因上游ELRepo源已被官方清空,下游的镜像源内也空了.
在这里插入图片描述

# 编辑/etc/yum.repos.d/elrepo.repo
vim /etc/yum.repos.d/elrepo.repo

elrepo.repo具体内容如下:

### Name: ELRepo.org Community Enterprise Linux Repository for el6
### URL: https://elrepo.org/

[elrepo]
name=ELRepo.org Community Enterprise Linux Repository - el6
baseurl=https://mirrors.aliyun.com/elrepo/elrepo/el6/$basearch/
#mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo.el6
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
protect=0

[elrepo-kernel]
name=ELRepo.org Community Enterprise Linux Kernel Repository - el6
baseurl=https://mirrors.aliyun.com/elrepo/kernel/el6/$basearch/
#mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-kernel.el6
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
protect=0

[elrepo-extras]
name=ELRepo.org Community Enterprise Linux Extras Repository - el6
baseurl=https://mirrors.aliyun.com/elrepo/extras/el6/$basearch/
#mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-extras.el6
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
protect=0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

教Linux的李老师

赞赏是第一生产力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值