1.备份系统自带yum源配置文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.back
2.通过curl下载yum源
需要服务器可以联网
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
如果是5,6,8,那就把7换成对应的数数字
网上给的更换yum源基本都是通过wget
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
如果有wget,可以用这个,没有就用curl那个
3.运行yum makecache生成缓存
yum makecache
4.更新yum源
yum -y update
5.安装wget
yum install -y wget
最后
以上就是洁净日记本最近收集整理的关于wget和yum都不能用时如何更换yum源并安装wget的全部内容,更多相关wget和yum都不能用时如何更换yum源并安装wget内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复