centos7.9安装完之后
1.修改源为阿里源
#!/bin/bash # 备份官方的原yum源的配置 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup # 下载Centos-7.repo文件,或者curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo,取决于你是否有wget的命令 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo # 清除yum缓存 yum clean all # 缓存本地yum源 yum makecache
添加执行权限执行即可,如果没有wget,可以手动下载仓库文件,拷贝到原有仓库文件即可
2.安装工具