首页 > 其他 > 详细

CentOS -配置yum源

时间:2020-11-28 19:40:51      阅读:23      评论:0      收藏:0      [点我收藏+]

CentOS  -配置yum源 

1 切换到yum目录

cd /etc/yum.repos.d/

2 创建一个备份文件夹

mkdir backup

3 把原配置都放进备份的文件

mv CentOS-* backup

4 下载阿里云YUM源配置文件

  方式1 -用curl

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

  方式2 -用wget

安装wget

yum install wget -y

用wget安装

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

5.如果出现了用yum install xxxxxx报错

sed -i -e /mirrors.cloud.aliyuncs.com/d -e /mirrors.aliyuncs.com/d /etc/yum.repos.d/CentOS-Base.repo
然后重启网卡
systemctl restart network

 

CentOS -配置yum源

原文:https://www.cnblogs.com/ltyc/p/14052972.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!