LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   yum config error parsing file failed - yum won't run (http://www.linuxquestions.org/questions/linux-software-2/yum-config-error-parsing-file-failed-yum-wont-run-567252/)

emuub 07-06-2007 06:02 PM

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

lazlow 07-06-2007 06:09 PM

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

emuub 07-07-2007 12:31 PM

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).

lazlow 07-07-2007 06:36 PM

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

emuub 07-08-2007 01:59 AM

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

emuub 07-08-2007 02:21 AM

replaced old dvd yum installation with new downloaded rpm copy.

No change.

emuub 07-08-2007 01:20 PM

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 :)

lazlow 07-08-2007 01:44 PM

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

emuub 07-15-2007 03:57 PM

Thanks for trying !
Just talking about a problem often helps me

woodyblue 11-04-2008 05:48 AM

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


All times are GMT -5. The time now is 02:57 AM.