LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-06-2007, 06:02 PM   #1
emuub
Member
 
Registered: Oct 2003
Location: North London, UK
Distribution: Fedora 14
Posts: 54

Rep: Reputation: 16
yum config error parsing file failed - yum won't run


F7 fresh install - running ok but can't update.Yum has never run at all.

How do i make yum run ?
This happens:

[root@localhost ~]# yum
CRITICAL:yum.cli:Config Error: Parsing file failed: File contains no section headers.
file: file:///etc/yum/yum.conf, line: 1
' [main]\n'

========
This is yum.conf:
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
===========

mike
 
Old 07-06-2007, 06:09 PM   #2
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 171Reputation: 171
Your /etc/yum/yum.conf looks ok. What do your repos in /etc/yum.repos.d look like?

Try:

yum clean all

Then try yum again
 
Old 07-07-2007, 12:31 PM   #3
emuub
Member
 
Registered: Oct 2003
Location: North London, UK
Distribution: Fedora 14
Posts: 54

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by lazlow
Your /etc/yum/yum.conf looks ok. What do your repos in /etc/yum.repos.d look like?

There are 3 files:
fedora.repo
fedora-updates.repo
fedora-updates-testing.repo

Note: gpgcheck=0 was =1 but i changed it to =0 (no difference in error)
(( side question: how do i attach the file to this thread rather than copying it in ??)

Contents: fedora.repo
fedora]
name=Fedora $releasever - $basearch
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[fedora-source]
name=Fedora $releasever - Source
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
================

fedora-updates.repo

[updates]
name=Fedora $releasever - $basearch - Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

[updates-debuginfo]
name=Fedora $releasever - $basearch - Updates - Debug
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/debug/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f$releasever&arch=$basearch
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

[updates-source]
name=Fedora $releasever - Updates Source
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/SRPMS/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-source-f$releasever&arch=$basearch
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
=======================

fedora-updates-testing.repo

[updates-testing]
name=Fedora $releasever - $basearch - Test Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-f$releasever&arch=$basearch
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test

[updates-testing-debuginfo]
name=Fedora $releasever - $basearch - Test Updates Debug
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/$releasever/$basearch/debug/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-debug-f$releasever&arch=$basearch
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test

[updates-testing-source]
name=Fedora $releasever - Test Updates Source
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/testing/$releasever/SRPMS/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-source-f$releasever&arch=$basearch
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test
========================


Quote:
Originally Posted by lazlow
Try::
yum clean all

Then try yum again
Tried this but same error message (immediately on entering the cmd).
 
Old 07-07-2007, 06:36 PM   #4
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 171Reputation: 171
emuub

My only guess is that you have a corrupted yum. You can try here to get another one: http://download.fedora.redhat.com/pu...fc7.noarch.rpm

The server has been a little slow today. Ok a lot slow.

Good Luck
Lazlow
 
Old 07-08-2007, 01:59 AM   #5
emuub
Member
 
Registered: Oct 2003
Location: North London, UK
Distribution: Fedora 14
Posts: 54

Original Poster
Rep: Reputation: 16
quote:Lazlow: My only guess is that you have a corrupted yum.

I have now un-installed (rpm -e) yum ad its dependancies, pirut, yum-updatesd

re-installed just yum-3.2.0-1.fc7 from the dvd.

same problem
(( [root@localhost ~]# yum
CRITICAL:yum.cli:Config Error: Parsing file failed: File contains no section headers.
file: file:///etc/yum/yum.conf, line: 1
' [main]\n')).
==================
will download a new version and see if that helps. . . .

mike
 
Old 07-08-2007, 02:21 AM   #6
emuub
Member
 
Registered: Oct 2003
Location: North London, UK
Distribution: Fedora 14
Posts: 54

Original Poster
Rep: Reputation: 16
replaced old dvd yum installation with new downloaded rpm copy.

No change.
 
Old 07-08-2007, 01:20 PM   #7
emuub
Member
 
Registered: Oct 2003
Location: North London, UK
Distribution: Fedora 14
Posts: 54

Original Poster
Rep: Reputation: 16
Lightbulb solved - its too many spaces !

I found that there was a space before every line of yum.conf. Edited it with vi to remove them (even before the #d lines).

Yum now runs as it should
 
1 members found this post helpful.
Old 07-08-2007, 01:44 PM   #8
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 171Reputation: 171
It is always the simple stuff that bites us in the butt. Another one to look for is there MUST be a return (enter or whatever) at the end of the file.

Sorry I was not of more help.

Lazlow
 
1 members found this post helpful.
Old 07-15-2007, 03:57 PM   #9
emuub
Member
 
Registered: Oct 2003
Location: North London, UK
Distribution: Fedora 14
Posts: 54

Original Poster
Rep: Reputation: 16
Thanks for trying !
Just talking about a problem often helps me
 
Old 11-04-2008, 05:48 AM   #10
woodyblue
LQ Newbie
 
Registered: May 2008
Posts: 2

Rep: Reputation: 0
Smile

in fact, the problem is obvious, you have type a blankspcae before "[main]", it should be
******************
'[main]\n'
...
******************
while yours is
******************
' [main]\n'
******************
so, delete the bankspace before "[main]"
and it will be ok

Last edited by woodyblue; 11-04-2008 at 05:49 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having [Config Error] while using YUM conellylg Fedora 7 09-17-2010 09:37 AM
Yum on FC6. 'yum update' error. mufy Fedora 8 06-14-2007 02:03 AM
Config Error: Error accessing config file: /etc/yum.conf dr_zayus69 Linux - Software 2 01-17-2006 05:20 PM
Error Parsing Config file for X chiefreborn Suse/Novell 5 08-31-2005 06:30 PM
Yum Errors in parsing, whats wrong here (yum.conf pasted) thejokker Linux - Newbie 1 06-15-2004 02:28 AM


All times are GMT -5. The time now is 12:42 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration