Shell Shell
Home
Shell
Linux
Network
Git
Blog (opens new window)
GitHub (opens new window)
Home
Shell
Linux
Network
Git
Blog (opens new window)
GitHub (opens new window)
  • Linux 核心技能与应用

    • 目录
    • Linux 的安装与配置
    • Linux 基础知识和命令
    • Linux 进阶知识和命令
    • 远程连接和 SSH
    • 文本编辑与版本控制
    • 网络和安全
    • Shell 脚本编程
    • 管理服务器和服务
    • Linux 开发神器
    • 内存与磁盘管理
    • 课程总结
  • Linux 命令行与 Shell 脚本编程大全

  • Linux 实战技能 100 讲

  • CentOS7 环境配置
  • CentOS7 更换国内软件源
    • 一键更换
    • 手动更换
      • CentOS 镜像
      • EPEL 镜像
  • CentOS7 安装 pigz
  • 编写 bash 脚本
  • linux
JaimeZeng
2022-03-13

CentOS7 更换国内软件源

# 一键更换

SuperManito/LinuxMirrors (opens new window)

$ sudo -i
# yum -y install curl wget
# bash <(curl -sSL https://cdn.jsdelivr.net/gh/SuperManito/LinuxMirrors@main/ChangeMirrors.sh)
1
2
3

# 手动更换

# CentOS 镜像

  1. 备份系统旧配置文件

    $ sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
    
    1
  2. 下载配置文件

    $ sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
    
    1
  3. 清除 yum 缓存

    $ sudo yum clean all
    
    1
  4. 刷新缓存

    $ sudo yum makecache
    
    1

    或者查看所有配置可以使用的文件,会自动刷新缓存。

    $ sudo yum repolist all
    
    1

# EPEL 镜像

EPEL (Extra Packages for Enterprise Linux) 是由 Fedora Special Interest Group 为企业 Linux 创建、维护和管理的一个高质量附加包集合适用于但不仅限于 Red Hat Enterprise Linux (RHEL), CentOS, Scientific Linux (SL), Oracle Linux (OL)

  1. 备份配置文件

    $ sudo mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
    
    1
  2. 下载配置文件

    $ sudo wget -O /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-7.repo
    
    1
  3. 清除 yum 缓存

    $ sudo yum clean all
    
    1
  4. 刷新缓存

    $ sudo yum makecache
    
    1

    或者查看所有配置可以使用的文件,会自动刷新缓存。

    $ sudo yum repolist all
    
    1
CentOS7 环境配置
CentOS7 安装 pigz

← CentOS7 环境配置 CentOS7 安装 pigz→

Theme by Vdoing | Copyright © 2020-2022 JaimeZeng | ❤️ | CC BY-NC-SA 4.0
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式