在打补丁时提示
[Errno 256] Couldn’t resolve host name for http://mirrors.cloud.aliyuncs.com/****/repomd.xml
实测mirrors.cloud.aliyuncs.com这个镜像站根本不能访问,因为是国产linux,不能换其他通用镜像网站,网上搜了下这个mirrors.aliyun.com镜像站是正常的,只需把网址mirrors.cloud.aliyuncs.com替换为mirrors.aliyun.com即可。做法与centOS类似:
- 终端或宝塔的文件管理,进入/etc/yum.repos.d,分别修改如下文件:
AliYun.repo
epel-modular.repo
epel-testing-modular.repo
epel-testing.repo
epel.repo
将mirrors.cloud.aliyuncs.com批量替换为mirrors.aliyun.com - 清理并重新生成yum缓存
终端执行如下命令
# yum clean all
# yum makecache
等待提示 Metadata cache created.即可正常yum了
在遇到[Errno256]Couldn’tresolvehostname错误时,针对国产Linux系统,无法切换其他镜像站。文章建议将mirrors.cloud.aliyuncs.com替换为mirrors.aliyun.com,通过修改/etc/yum.repos.d目录下的配置文件并批量替换URL,然后执行yumcleanall和yummakecache来清理并重建yum缓存,以恢复正常更新。
5674

被折叠的 条评论
为什么被折叠?



