The file does not contain section headers
I keep getting this error every time 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 (small month) and have not used it very much because I just started my technical education.
It seems that CentOS-Base.repo had a bug and I was actually trying to create a priority.sh to follow this tutorial from my school: https://ensiwiki.ensimag.fr/index.php/Portail:Centos which could have made a mistake.
(The first section is titled "Depots Centos 6.5")
I don't know if this will help you.
This error occurs every time you use yum. Here, I was just trying to get Unison from the epel package I already got on my computer.
Thanks for your help!
source to share
It looks like yours is /etc/yum.repos.d/CentOS-Base.repo
not working - missed [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'
So the fix should be to go to /etc/yum.repos.d/CentOS-Base.repo
and fix the syntax of the file.
source to share