在使用Centos6版本yum时报错

Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
No package gcc available.
Error: Nothing to do

出现这种错误的原因可能是因为没联网,试着ping 一下百度,如果ping的通还报错,说明yum镜像没了,国内比较快的有163源、sohu源。这里以163源为例子。那么可以依次执行以下命令

cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.backup
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
mv CentOS6-Base-163.repo CentOS-Base.repo
yum clean all

解决

相关文章:

  • 2022-12-23
  • 2021-07-23
  • 2021-06-09
  • 2022-01-12
  • 2022-03-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-07
  • 2022-01-20
  • 2021-09-18
  • 2021-05-23
  • 2021-08-20
  • 2022-01-02
相关资源
相似解决方案