文件不包含节标题 [英] File contains no sections headers

查看:662
本文介绍了文件不包含节标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我每次使用yum时都会收到此错误:

I keep getting this error everytime i use yum :

yum install unison240
Loaded plugins: fastestmirror, priorities, refresh-packagekit, security
Error: File contains no section headers.
file: file://///etc/yum.repos.d/CentOS-Base.repo, line: 12
'priority=1\n'

我对这个世界很新(一个小月),并没有使用它,因为我刚刚开始工程学校。

I am very new to this world (A small month) and didnt use it very much yet because i just started engineering school.

似乎CentOs-Base.repo中有一个错误,我实际上试图创建priorities.sh,以便从我的学校遵循本教程: https://ensiwiki.ensimag.fr/index.php/Portail:Centos 发生错误。

It seems as if CentOs-Base.repo had an error in it and i actually tried to create priorities.sh in order to follow this tutorial from my school : https://ensiwiki.ensimag.fr/index.php/Portail:Centos which could have done the error.

(第一部分命名为Depots Centos 6.5)

(First Section named "Depots Centos 6.5")

每次使用yum时都会发生此错误。

This error happens with every use of yum. Here, I was just trying to get Unison from the package epel that i already got on my computer.

感谢您的帮助!

推荐答案

看起来您的 /etc/yum.repos.d/CentOS-Base.repo 已损坏 - 缺少 [CentOS-Base] 节。我能够使用以下方式重现这种情况:

Looks like your /etc/yum.repos.d/CentOS-Base.repo is broken - have missing [CentOS-Base] stanza. I was able to recreate the situation using:

# cat /etc/yum.repos.d/kzak-mytt-kz.repo 
[kzak-mutt-kz]
name=Copr repo for mutt-kz owned by kzak
baseurl=http://copr-be.cloud.fedoraproject.org/results/kzak/mutt-kz/fedora-$releasever-$basearch/
skip_if_unavailable=True
gpgcheck=0
enabled=1
# yum repolist
<works as expected>
# gedit /etc/yum.repos.d/kzak-mytt-kz.repo   # now I have removed first line
# cat /etc/yum.repos.d/kzak-mytt-kz.repo 
name=Copr repo for mutt-kz owned by kzak
baseurl=http://copr-be.cloud.fedoraproject.org/results/kzak/mutt-kz/fedora-$releasever-$basearch/
skip_if_unavailable=True
gpgcheck=0
enabled=1
# yum repolist
Loaded plugins: etckeeper
File contains no section headers.
file: file:///etc/yum.repos.d/kzak-mytt-kz.repo, line: 1
'name=Copr repo for mutt-kz owned by kzak\n'

所以修复会进入 /etc/yum.repos.d /CentOS-Base.repo 并修复文件的语法。

So fix would be to go into /etc/yum.repos.d/CentOS-Base.repo and fix syntax of the file.

这篇关于文件不包含节标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆