2017-07-01 50 views
0

所有文件都從/etc/yum.repos.d/目錄中刪除。我怎樣才能重新安裝新的CentOS 7安裝附帶的默認回購文件。安裝默認回購CentOS 7

當我執行以下命令「百勝repolist所有」我得到以下結果:

Loaded plugins: fastestmirror, landpacks 
Loading mirror speeds from cached hostfile 
repolist: 0 

謝謝。

+0

相關:https://unix.stackexchange.com/questions/52666/how-do-i-install-the-stock- CentOS的儲存庫 – Azeem

回答

0

重建你默認的CentOS yum.repo.d文件夾

在一個dev的機器,不知何故,我設法抹去我yum.repo.d內容。我想重建回購文件回到他們的默認值。首先,你需要找出你使用的是什麼版本:

cat /etc/redhat-release 

然後訪問正確的版本在:http://vault.centos.org/

navigate to the correct os/x86_64/CentOS/ directory (could be os/x86_64/CentOS/ i386/) 
Download the following files to the server: 
    wget http://vault.centos.org/5.x/os/x86_64/CentOS/centos-release-notes-5.x-0.x86_64.rpm 
    wget http://vault.centos.org/5.x/os/x86_64/CentOS/centos-release-5-x.el5.centos.x86_64.rpm 
Then install the two rpms: 
    rpm -Uivh *.rpm 

應該回到原來的運輸回購文件。

貸:在Linux中 參考於2011年7月8日,jbmurphy - http://www.jbmurphy.com/2011/07/08/rebuild-your-the-default-centos-yum-repo-d-folder/