天天看點

CentOS下yum指令報錯File contains no section headers. file: file:///etc/yum.repos.d/ 出現:file://mnt 的問題

在使用yum指令執行安裝指令時,報錯File contains no section headers. file: file:///etc/yum.repos.d/

以及出現 file:///mnt

原因是配置中沒有配置yum源

yum 的一切配置資訊都儲存在yum.repos.d 的目錄下

操作:

cd /etc/yum.repos.d
rm -rf ./*  						#删除所有檔案
ls									#檢視是否有檔案,要確定沒有其他檔案
vim CentOS7.repos
	[CentOS7]						#按下i 進行輸入
	name = CentOS-service
	baseurl = file:///mnt
	enabled = 1
	gpgcheck = 0					#結束,按下ESC,輸入:wq,回車


yum clean all						#清理緩存
yum list							#能檢視到許多的檔案包,說明沒問題
           

繼續閱讀