sudo获取权限。cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
cat /etc/centos-release命令可查看系统版本,具体命令如下:
| 系统版本 | 阿里云源命令 | 清华大学源命令 |
|---|---|---|
| CentOS 7 | wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo |
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tuna.tsinghua.edu.cn/repo/Centos-7.repo |
| CentOS 8 | wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo |
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tuna.tsinghua.edu.cn/repo/Centos-8.repo |
若系统没有 wget 工具,可先执行yum install -y wget安装。 |
yum clean all # 清除原有缓存
yum makecache # 生成本地缓存
yum repolist查看当前可用的软件源仓库,也可尝试安装软件测试,比如:
微信客服
扫一扫,添加我为朋友