在Ubuntu系统上使用YUM需注意其非默认工具属性,以下为针对性优化建议:
apt update
/apt install
替代YUM命令。/etc/yum.conf
,设置keepcache=1
。yum clean expire-cache
或设置cron任务自动清理。/etc/yum.repos.d/*.repo
,仅保留必要仓库,替换为国内高速镜像源(如清华源)。yum-config-manager
禁用非必要仓库:sudo yum-config-manager --disable <repo_id>
。/etc/yum.conf
中设置max_parallel_downloads=5
(数值根据网络调整),或安装yum-presto
插件加速。yum autoremove
清理无用依赖包,避免冗余。⚠️ 注意:YUM与Ubuntu的APT可能存在依赖冲突,非必要场景建议直接使用APT工具。