配置RHEL和centOS的阿里云镜像源

备份

sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

编辑 YUM 仓库配置文件

sudo vi /etc/yum.repos.d/CentOS-Base.repo

配置内容:

base

name=CentOS-7 - Base - Aliyun

baseurl=http://mirrors.aliyun.com/centos/7/os/ b a s e a r c h / g p g c h e c k = 1 g p g k e y = h t t p : / / m i r r o r s . a l i y u n . c o m / c e n t o s / 7 / o s / basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/7/os/ basearch/gpgcheck=1gpgkey=http://mirrors.aliyun.com/centos/7/os/basearch/RPM-GPG-KEY-CentOS-7

updates

name=CentOS-7 - Updates - Aliyun

baseurl=http://mirrors.aliyun.com/centos/7/updates/ b a s e a r c h / g p g c h e c k = 1 g p g k e y = h t t p : / / m i r r o r s . a l i y u n . c o m / c e n t o s / 7 / o s / basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/7/os/ basearch/gpgcheck=1gpgkey=http://mirrors.aliyun.com/centos/7/os/basearch/RPM-GPG-KEY-CentOS-7

编辑 EPEL 仓库配置文件 epel.repo
sudo vi /etc/yum.repos.d/epel.repo

编辑内容:

epel

name=Extra Packages for Enterprise Linux 7 - b a s e a r c h − A l i y u n b a s e u r l = h t t p : / / m i r r o r s . a l i y u n . c o m / e p e l / 7 / basearch - Aliyun baseurl=http://mirrors.aliyun.com/epel/7/ basearch−Aliyunbaseurl=http://mirrors.aliyun.com/epel/7/basearch

failovermethod=priority

enabled=1

gpgcheck=0

gpgkey=http://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-7

清理缓存

sudo yum clean all

生成缓存(重新生成缓存,以验证配置是否正确)

sudo yum makecache

尝试安装软件:

sudo yum install tftp-server tftp

相关推荐
皓月盈江1 小时前
Windows 复制文件夹到 Linux 后显示“带锁”解决方法
linux·运维·windows·linux文件·文件带锁·文件夹带锁
byte轻骑兵1 小时前
异构混合环境远程控制工具适配对比(Windows / Mac / Linux / 国产系统 / arm64 / 鸿蒙)
linux·windows·macos·远程办公
jiecy2 小时前
用 AI 手搓海康视频播放插件:NVR 在 Linux 网页下实时播放、回放
linux·运维·服务器
第404号工位3 小时前
从 USB MSC 写入缓存与 exFAT/NTFS 日志机理看“安全弹出”的本质:Linux dirty page 与 FTL 实测
linux·操作系统
海边捡石子3 小时前
用 Nuitka 保护 Python 核心业务源码
linux·后端·python
YMWM_3 小时前
ubuntu24.04自带录屏软件使用指南
linux·具身智能
云老大-阿里云国际站代理商4 小时前
阿里云国际站CDN回源502错误,源站正常该如何排查?
阿里云·云计算
qetfw4 小时前
Debian 磁盘实验:RAID5、LVM 与 LUKS 分层及挂载验证
linux·运维·debian·raid
沫璃染墨5 小时前
从零入门计算机网络系列(三十三):Linux I/O 多路复用详解——epoll 核心接口、底层原理与事件通知机制
linux·运维·服务器·c++·驱动开发·系统架构·硬件架构
showker5 小时前
阿里云 CentOS 6 编译安装 PHP 8.5 完整指南
阿里云·centos·php