PDA

View Full Version : YUM install


reddwarf2956
19th March 2004, 07:27 PM
I just installed Yum and got this (I already placed yum.conf from " http://fedora.artoo.net/faq/ Q. 2" in the etc dir and edited it to add the info from "Software > How to update KDE" thread ):

# rpm -ivh yum-2.0.6-1.noarch.rpm

Preparing... ########################################### [100%]
1:yum warning: /etc/yum.conf created as /etc/yum.conf.rpmnew
########################################### [100%]
# yum 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.2/ConfigParser.py", line 233, in read
self.__read(fp, filename)
File "/usr/lib/python2.2/ConfigParser.py", line 444, in __read
raise MissingSectionHeaderError(fpname, lineno, `line`)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /etc/yum.conf, line: 1
'\xef\xbb\xbf# This is a yum.conf for Fedora Core.\n'
#

What is wrong?

kai_t
19th March 2004, 09:21 PM
Using a text editor, make sure that the first line in /etc/yum.conf begins with a # (hash sign), not with any garbage characters. Otherwise, yum doesn't interpret it as a comment line.

reddwarf2956
19th March 2004, 10:30 PM

The first 26 lines start with the # sign as to comment things too. So, that is not it.

Thanks kai_t.

mhelios
19th March 2004, 10:55 PM
See these posts for inspiration:
http://www.redhat.com/archives/fedora-list/2004-February/msg01810.html
http://www.redhat.com/archives/fedora-list/2004-February/msg01893.html

A couple points: If you're upgrading software, use the U switch with rpm, i.e. `rpm -Uvh`
Try using yum itself to upgrade yum. :) `yum update yum`

kai_t
19th March 2004, 11:08 PM
Originally posted by reddwarf2956
'\xef\xbb\xbf# This is a yum.conf for Fedora Core.\n' I just learnt that the hexadecimal values EF, BB and BF (in that order) form the so-called "byte order mark" (http://www.unicode.org/unicode/faq/utf_bom.html#BOM) (BOM) for UTF-8-encoded files. I don't know how exactly it got there, but yum obviously gets confused by it.

Try removing the BOM: env LC_ALL=C PERL_UNICODE= perl -pi~ -0777 -e "s/^\xEF\xBB\xBF//s;" /etc/yum.conf

reddwarf2956
20th March 2004, 02:24 AM
Re: YUM install

quote:I just learnt that the hexadecimal values EF, BB and BF (in that order) form the so-called "byte order mark" (BOM) for UTF-8-encoded files. I don't know how exactly it got there, but yum obviously gets confused by it.

Try removing the BOM: env LC_ALL=C PERL_UNICODE= perl -pi~ -0777 -e "s/^\xEF\xBB\xBF//s;" /etc/yum.conf

First of all thanks I now see what is was. I lost my text editors when I lost KDE, so I used oo-write and saved as a text file without the ".txt". I finally figured out how to get around the fact that "Add/Remove Packages" program does not work too. So, I put the CD that it gets hung on in the drive and looked for the package gedit for gnome. Installed it. I then edit /etc/yum.conf deleting the first char. # and replaced it with a new #. saved and run yum.

It works with a "yum check-update" command. Now this is the first time I ran that, when it is finished are the files updated? or was that just a test run? How to check for updated files?

kai_t
20th March 2004, 03:36 AM
Originally posted by reddwarf2956
It works with a "yum check-update" command. Now this is the first time I ran that, when it is finished are the files updated? or was that just a test run?According to what man yum says, that command just lists available package updates and returns a corresponding exit code useful for scripts (e. g., automated updates).

To actually update all packages, run yum update.

reddwarf2956
20th March 2004, 04:00 AM
Thanks kai_t
http://www.fedoraforum.org/forum/newreply.php?s=&action=newreply&threadid=875#

This one can be closed.