-   Linux - Distributions (
-   -   yum problem: section headers missing (

jarco 02-23-2011 03:24 PM

yum problem: section headers missing
ok. I am using a Centos virtual server with plesk. In my not so successful quest to get my php version updated I seem to have something wrong with yum.

I get this error when trying to use it:

[root@ims34177 ~]# yum update php
Loaded plugins: fastestmirror
Config Error: File contains no section headers.
file: file://///etc/yum.repos.d/CentOS-Testing.repo, line: 1
' # CentOS-Testing:\n'

I just want to get php to a version where it supports joomla 1.6.

Any tips?

fordeck 02-23-2011 03:39 PM

Perhaps you could post the contents of /etc/yum.repos.d/CentOS-Testing.repo? When you post the output please surround your code with code blocks, for example:

Example code block usage



jarco 02-23-2011 04:02 PM


[root@ims34177 ~]# cat /etc/yum.repos.d/CentOS-Testing.repo
  # CentOS-Testing:
  # !!!! CAUTION !!!!
  # This repository is a proving grounds for packages on their way to
CentOSPlus and CentOS Extras.
  # They may or may not replace core CentOS packages, and are not
guaranteed to function properly.
  # These packages build and install, but are waiting for feedback from
testers as to
  # functionality and stability. Packages in this repository will come
and go during the
  # development period, so it should not be left enabled or used on
production systems without due
  # consideration.
  name=CentOS-5 Testing
[root@ims34177 ~]#

Is this what you mean?

fordeck 02-23-2011 06:13 PM

It looks like all of the lines in this file have leading spaces. The lines can not begin with spaces. Try stripping the leading spaces off of each line and then try your update again.



jarco 02-23-2011 06:30 PM

Fantastic. That was the solution. Great and fast help. I see the stories about the Linux community are true.

fordeck 02-23-2011 06:34 PM

Good to hear that it worked. If your issue is solved please mark this thread as solved using the Thread Tools at the top of the page.



Sorry looks like you already did.

JerZ 01-29-2013 02:03 PM

I am running into this same problem. This is the message I am getting though:

Loaded plugins: fastestmirror
File contains no section headers.
file: file://///etc/yum.repos.d/CentOS-Media.repo, line: 8
‘yum –enablerepo=c6-media\\n\n’
Usage: yum [options] COMMAND

I followed the advice about the leading spaces however I still get this message.

knudfl 01-29-2013 02:25 PM

Post # 7, @ JerZ : Welcome to LQ.


‘yum –enablerepo=c6-media\\n\n’
That's an odd hyphen ( – ).
Yum options with hyphens are with two hyphens : --<option> .

So it could be : ‘yum --enablerepo=c6-media\\n\n’
... if the other characters are right.


JerZ 01-29-2013 02:29 PM

You are correct it should be -- and not the single -. Also to add to this, I am trying to install the perl package off of a local repository (DVD). I deleted the "\n" from my .conf.

JerZ 01-29-2013 02:47 PM

1 Attachment(s)
This is what the .conf looks like.

John VV 01-29-2013 03:37 PM

you really do NOT want to use the centos 6 install dvd as a source for rpms
( unless you have NO other choice , as it you are in the middle of nowhere with NO network connection)

the dvd is very out of date
the centos 6.3 dvd is less out of date than the centos 6.0 , but still out of date.
the centos 6.3 dvd was released on July 9 2012 .
the centos 6.0 dvd was released on July 10 2011.

the install media repo should normally be turned off .
this is normally done during the install , but do to bugs it is not always turned off .

JerZ 01-29-2013 03:48 PM

I have CentOS 6.3 (Minimal) running on (2) servers that do not have internet connections. I am running them on ESXi 5.1 and I need to install VMWare tools, but can't do to not having perl installed.

The idea of wiping and starting fresh was brought up and using Basic Server instead. Is this a better idea?

John VV 01-29-2013 08:51 PM

you can set up a personal "repo" for the prerequisites needed on a computer that dose have a internet connection
transfer them to a usb and use that to install rpm's on the servers
temporally get the two servers a outside connection

but seeing as you are just at the start of all this a new clean install would be better for a starting point

Riazjamali 12-27-2017 12:21 AM

yum repo list
i m using Redhad , facing this issue
i cant update modifiey or insatall any package

file: file://///etc/yum.repos.d/redhat.repo, line: 9

All times are GMT -5. The time now is 02:37 PM.