今天在centos上想要通过yum安装gcc,解决报错:YumRepo Error: All mirror URLs are not using ftp, http[s] or file 解决方案: 先编辑CentOS-Base.repo文件 命令行:vi /etc/yum.repos.d/CentOS-Base.repo打开后编辑,首先注释掉mirrorlist,然后打开baseurl,接着修改镜像地址为:http://vault.centos.org/centos/6.8/,6.8修改为你自己centos的版本。 最后退出保存,重新执行yum安装命令即可