1、在 CentOS 7.6 64位 下执行命令:yum makecache ,以更新 yum 源 的缓存,报错:There are no enabled repos,如图1

[root@iZ8vb0tg9av3a17vlbfi28Z ~]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
To enable Red Hat Subscription Management repositories:
subscription-manager repos --enable
To enable custom repositories:
yum-config-manager --enable
2、决定重新安装 7.6 的 release 包,先到阿里云源的网站,查找到对应的 release 包,复制其链接,如图2

3、依次执行如下命令,如图3

wget https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/centos-release-7-6.1810.2.el7.centos.x86_64.rpm
rpm -ivh --replacepkgs --replacefiles centos-release-7-6.1810.2.el7.centos.x86_64.rpm
yum update
4、执行命令:yum makecache ,以更新 yum 源 的缓存,未再报错,符合预期,如图4

[root@iZ8vb0tg9av3a17vlbfi28Z ~]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.huaweicloud.com
* updates: mirrors.huaweicloud.com
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
(1/8): extras/7/x86_64/prestodelta | 47 kB 00:00
(2/8): extras/7/x86_64/filelists_db | 231 kB 00:00
(3/8): extras/7/x86_64/other_db | 118 kB 00:00
(4/8): updates/7/x86_64/prestodelta | 358 kB 00:00
(5/8): updates/7/x86_64/other_db | 351 kB 00:00
(6/8): updates/7/x86_64/filelists_db | 2.2 MB 00:00
(7/8): base/7/x86_64/other_db | 2.6 MB 00:00
(8/8): base/7/x86_64/filelists_db | 7.1 MB 00:04
Metadata Cache Created
Linux 服务器运维、部署与线上故障排查
如果你的网站或后端服务部署在 Linux 服务器上,遇到访问异常、Nginx 配置问题、MySQL / Redis 异常、Docker 服务不可用、磁盘占满、CPU / 内存过高等问题,可以联系我做一次远程排查。
适合以下场景:
✅ 网站打不开或访问不稳定
✅ Nginx / PHP-FPM 配置异常
✅ MySQL / Redis 性能或连接问题
✅ Docker 服务部署与维护
✅ 服务器迁移与环境配置
✅ CPU / 内存 / 磁盘异常排查
服务内容:
✅ Linux 环境检查
✅ 网站部署与迁移
✅ Nginx / PHP-FPM / MySQL / Redis 排查
✅ Docker 配置与维护
✅ 服务器性能分析
✅ 长期远程运维支持
如需咨询,请联系我,并注明:Linux 运维咨询。
联系方式:
Telegram:@shuijingwan
微信:13980074657
邮箱:shuijingwanwq@gmail.com

发表回复