首先备份
/etc/yum.repos.d/CentOS-Base.repo
使用mv命令备份文件linux命令,一般在文件后面加.backup
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-fasttrack.repo CentOS-Vault.repo
CentOS-Debuginfo.repo CentOS-Media.repo
[root@localhost yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.backup
[root@localhost yum.repos.d]# ls
CentOS-Base.repo.backup CentOS-fasttrack.repo CentOS-Vault.repo
CentOS-Debuginfo.repo CentOS-Media.repo
[root@localhost yum.repos.d]# rm -rf *.repo
[root@localhost yum.repos.d]# ls
CentOS-Base.repo.backup
下载前先安装 wget
命令:yum -y install wget
163源镜像地址
CentOS7_repo下载
命令下载
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
CentOS6_repo下载
命令下载
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS5_repo下载
命令下载
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo
阿里云源镜像地址
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
上一个教程:Linux常用命令大全word免费下载
下一个教程:linux命令后台运行