Centos yum installation software No package XXX available.

When installing bind recently, NO package bind available appears as follows:

[root@host /]# yum -y install bind
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
No package bind available.

   I am used to installing software with yum, and I feel that the downloaded configuration file is broken. So I checked the information on the Internet and finally found the reason: there is a configuration file in Centos that stores various software download information. When installing with yum, it will automatically find the software mirror site. Heard thousands of them. Enter the following path to see:

 ls /etc/yum.repos.d/

we will see a file

CentOS-Base.repo

enter command line

cat CentOS-Base.repo

The result is empty.

First backup /etc/yum.repos.d/CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

Download the corresponding version of the repo file and put it in /etc/yum.repos.d/ (please make a corresponding backup before operation)

Run yum makecache to generate the cache.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325972309&siteId=291194637