LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Yum not working (https://www.linuxquestions.org/questions/fedora-35/yum-not-working-246886/)

acidblue 10-24-2004 06:52 PM

Yum not working
 
This is the error messages I get when I try to run yum:

[root@darkstar root]# yum check update
Traceback (most recent call last):
File "/usr/bin/yum", line 30, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum/yummain.py", line 163, in main
(log, errorlog, filelog, conf, cmds) = parseCmdArgs(args)
File "/usr/share/yum/yummain.py", line 75, in parseCmdArgs
conf=yumconf(configfile=yumconffile)
File "/usr/share/yum/config.py", line 48, in __init__
self.cfg.read(configfile)
File "/usr/lib/python2.3/ConfigParser.py", line 263, in read
self._read(fp, filename)
File "/usr/lib/python2.3/ConfigParser.py", line 456, in _read
raise MissingSectionHeaderError(fpname, lineno, `line`)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /etc/yum.conf, line: 1
'\xef\xbb\xbf[main]\n'

This is my yum.conf file

[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
retries=20

[base]
name=Fedora Core $releasever - $basearch - Base
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/

[updates-released]
name=Fedora Core $releasever - $basearch - Released Updates
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/

#[updates-testing]
#name=Fedora Core $releasever - $basearch - Unreleased Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/testing/$releasever/$basearch/

#[development]
#name=Fedora Core $releasever - Development Tree
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/development/$basearch/

misc 10-24-2004 08:29 PM

Re: Yum not working
 
Quote:

ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /etc/yum.conf, line: 1
'\xef\xbb\xbf[main]\n'
Yum sees extra characters in front of [main]. Can you take a text editor, delete the first line, then put back [main]? If that doesn't help, delete /etc/yum.conf, "rpm -e yum" and reinstall the package.

acidblue 10-24-2004 08:41 PM

OMG, that worked I just did what you said, re-typed the first line, don't know why that worked ,there weren't any spaces or anything on the first line, but hey what ever works right?

misc 10-24-2004 08:47 PM

A good text editor (e.g. Emacs) would have displayed a character.

In a non-Unicode locale, you would have seen the extra values, too:

Code:

$ env LC_ALL=C less yum.conf
"yum.conf" may be a binary file.  See it anyway?

<EF><BB><BF>[main]
and so on.



All times are GMT -5. The time now is 09:29 AM.