You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在CentOS 8上安装moreutils?解决依赖与仓库报错问题

CentOS 8 安装moreutils报错解决方案

问题原因

两个报错分别对应两个核心问题:

  1. 直接安装时缺少perl(IPC::Run)依赖:该依赖包默认存放在powertools仓库中,CentOS 8默认未启用该仓库
  2. 启用仓库时报错Unknown repo: 'PowerTools':CentOS 8中该仓库的官方ID为全小写的powertools,不是首字母大写格式

解决步骤

  • 先安装dnf配置管理插件(未安装的情况下执行):
dnf install -y dnf-plugins-core
  • 启用powertools仓库:
dnf config-manager --set-enabled powertools
  • 重新安装moreutils即可:
dnf install -y moreutils
  • 验证安装成功(以sponge工具为例):
sponge --version

异常兜底(如找不到powertools仓库)

如果执行上述步骤仍提示找不到powertools仓库,说明你的CentOS 8系统默认源已失效(CentOS 8已于2021年底停止官方支持),可先执行以下命令替换为vault源后再走上述安装步骤:

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
dnf clean all && dnf makecache

内容的提问来源于stack exchange,提问作者user1079703

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.07 07:57:00