当前位置: 首页 > news >正文

Centos6配置yum源

Centos6配置yum源

    • 为Centos6配置CentOS Vault源—防止yum源过期
    • 为Centos6配置epel源
    • 为Centos6配置ELRepo源---已ELRepo被官方清空
    • Centos6安装docker
      • docker配置国内镜像加速

为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源
    https://developer.aliyun.com/mirror/epel?spm=a2c6h.13651102.0.0.3e221b11ILV8ex
# 阿里云的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被官方清空

在这里插入图片描述

# 编辑/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

Centos6安装docker

CentOS 6.5 (64-bit) 或更高的版本,要求系统为64位、系统内核版本为 2.6.32-431 或者更高版本。
Centos6的内核支持的docker最高版本是:docker-engine-1.7.1-1.el6.x86_64.rpm
免积分下载docker的rpm包: https://download.csdn.net/download/omaidb/90522506

# 安装docker
yum install  -y ./docker-engine-1.7.1-1.el6.x86_64.rpm

在这里插入图片描述

# 启动docker服务
service docker start
# 查看docker版本
docker version

在这里插入图片描述


docker配置国内镜像加速

vim /etc/sysconfig/docker

配置内容如下

other_args="--registry-mirror=https://docker.1ms.run"

验证搜索镜像

docker search docker.1ms.run/${镜像名称}

在这里插入图片描述

# 拉取镜像
docker pull nginx

在这里插入图片描述

相关文章:

  • 国企笔试之2025年中广核校招SHL测评笔试内容详解
  • 一文了解 threejs 中.bin 文件与 .gltf 文件 和 .glb 文件三者之间的关系
  • 汽车芯片成本控制:挑战、策略与未来趋势
  • 数学建模中的最大最小值模型详解
  • vue3:十一、主页面布局(优化页面跳转方式)
  • 网络层之IP协议
  • MySQL拒绝访问
  • 使用Docker部署MySQL8.0.29
  • SpringDoc和Swagger使用
  • LeetCode 热题 100_划分字母区间(80_763_中等_C++)(贪心算法(求并集))
  • 点亮STM32最小系统板LED灯
  • 烧结银技术赋能新能源汽车超级快充与高效驱动
  • C/C++转换为字符串宏和字符串拼接宏的综合使用
  • [HY000][1366] Incorrect string value: ‘张三‘ for column ‘name‘ at row 1
  • 基于vue框架的在线影院系统a079l(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
  • 鸿蒙生态开发
  • 【Java】深入了解下Java Bitset
  • SOFABoot-09-模块隔离
  • 计算机的基本组合和工作原理
  • 日志2333
  • 《探秘海昏侯国》数字沉浸特展亮相首届江西文化旅游产业博览交易会
  • 解放日报:人形机器人新赛道正积蓄澎湃动能
  • 夜读丨春天要去动物园
  • 五大国货美妆去年业绩分化:珀莱雅百亿营收领跑,上海家化转亏
  • 北方旱情持续,水利部:大中型灌区春灌总体有保障
  • 摩根大通任命杜峯为亚太区副主席,加码中国市场业务布局