首頁  >  文章  >  運維  >  centos yum無法使用怎麼解決

centos yum無法使用怎麼解決

尚
原創
2020-03-25 16:47:583281瀏覽

centos yum無法使用怎麼解決

在用yum安裝gcc的時候,報了錯誤:

[root@001 ~]#yum -y install gcc gcc-c++ kernel-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 To enable Red Hat Subscription Management repositories:
     subscription-manager repos --enable <repo>
 To enable custom repositories:
     yum-config-manager --enable <repo>

1、檢查是否斷網

ping www.baidu.com

2、如果沒斷網,則說明是yum鏡像沒有了,需要下載一個:

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

相關影片教學推薦:linux影片教學

以上是centos yum無法使用怎麼解決的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn