【CentOS7】解决 CentOS 7 使用 `yum` 时出现的错误

解决 CentOS 7 使用 yum 时出现的错误

问题

在使用 yum 进行各种操作时(例如 Plesk 更新、系统更新、软件包安装等),可能会出现以下错误:

复制代码
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"

14: curl#6 - "Failed to resolve host: mirrorlist.centos.org; Unknown error"

Cannot find a valid baseurl for repo: base/7/x86_64

原因

2024 年 7 月 1 日,CentOS 7 达到了其生命周期的终点,CentOS 团队已将其存储库移动到 vault.centos.org。如果不更新存储库 URL,软件包将无法更新或验证,从而导致这些错误。

解决方案

对于 Plesk 18.0.61 和 18.0.62 版本,发布了自动修复程序。安装最新的 Plesk 更新后,存储库 URL 将自动调整。

对于 Plesk 18.0.60 及更早版本

  1. 通过 SSH 登录到服务器。

  2. 运行以下命令来下载并执行修复脚本:

    bash 复制代码
    curl -fsSL https://autoinstall.plesk.com/PSA_18.0.62/examiners/repository_check.sh | bash -s -- update >/dev/null

注意事项

应用解决方案后,建议使用可用的选项之一升级到更新的操作系统版本。

相关推荐
Avan_菜菜15 小时前
FRP 内网穿透完整实战:从 HTTP 映射到 HTTPS 自签代理
运维·nginx·https
Sokach10151 天前
Linux Shell 脚本从零到能用:一个新手的一天学习总结
linux
SelectDB2 天前
Litefuse 开源并推出单进程轻量模式,25 秒就能跑起来的 Agent 可观测与评估平台
运维·后端·自动化运维
AlfredZhao2 天前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
zzzzzz3103 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode3 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220704 天前
如何搭建本地yum源(上)
运维
A小辣椒5 天前
TShark:Wireshark CLI 功能
linux
A小辣椒5 天前
TShark:基础知识
linux
AlfredZhao5 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci