阿里云云服务器软件包的避坑安装指南

本文介绍了作者在阿里云服务器上遇到Certbot包缺失的问题,详细阐述了如何删除不适用的EPEL、安装官方EPEL、调整EPEL源至清华源,以及配置EPEL-modular源的过程,确保用户可以顺利安装所需的包。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本人近日试图在阿里云的云服务器上安装certbot包,然而提示找不到,经过一系列摸索,终成功安装,遂总结流程于下,供新手参考,以便少走弯路。本文适用于CentOS和Alibaba Cloud Linux系统。

EPEL (Extra Packages for Enterprise Linux)是基于Fedora的一个项目,为“红帽系”的操作系统提供额外的软件包。阿里系统自带的EPEL似乎不太好用,首先我们需要将其删掉。命令为:

yum remove epel-aliyuncs-release-8-15.1.al8.noarch

其中的包名视实际而定。然后安装官方EPEL:

yum install epel-release

然后调整EPEL源,首先清除缓存:

yum clean all

然后运行以下命令,将EPEL设为清华源:

sed -e 's!^metalink=!#metalink=!g' \
-e 's!^#baseurl=!baseurl=!g' \
-e 's!https\?://download\.fedoraproject\.org/pub/epel!https://mirrors.tuna.tsinghua.edu.cn/epel!g' \
-e 's!https\?://download\.example/pub/epel!https://mirrors.tuna.tsinghua.edu.cn/epel!g' \

然后修改EPEL-modular源。首先打开/etc/yum.repos.d/epel-modular.repo文件,然后注释其中metalink所在行,并在下面添加阿里云镜像,效果如下:

[epel-modular]
name=Extra Packages for Enterprise Linux Modular $releasever - $basearch
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
# baseurl=https://download.example/pub/epel/$releasever/Modular/$basearch
# metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-modular-$releasever&arch=$basearch&infra=$infra&content=$contentdir
baseurl=http://mirrors.cloud.aliyuncs.com/epel/8/Everything/$basearch
enabled=1
gpgcheck=1
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8

最后更新缓存:

yum makecache

即可顺利安装你想要的包了。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值