Bug 474073 - yum traceback - can't install/upgrade/remove packages.
Summary: yum traceback - can't install/upgrade/remove packages.
Keywords:
Status: CLOSED DUPLICATE of bug 473239
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: 10
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-12-02 00:17 UTC by aob.phantom
Modified: 2014-01-21 23:07 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-12-02 16:22:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description aob.phantom 2008-12-02 00:17:11 UTC
Description of problem:
Yum was working fine.  F9 was up to date ....  Upgraded F9 to F10 using yum to upgrade as both dvd and preupgrade failed to work cleanly.

After the upgrade grub refused to work.  So used the dvd to reinstall yum.
F10 now boots etc but yum refuses to update or remove. 

Version-Release number of selected component (if applicable):
yum.noarch 3.2.20-3.fc10                 

How reproducible:
Always

Steps to Reproduce:
1.  Yum install packagename
2.  Yum remove packagename
3.  Yum groupinstall group
  
Actual results:
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 229, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 145, in main
    (result, resultmsgs) = base.buildTransaction() 
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 649, in buildTransaction
    (rescode, restring) = self.resolveDeps()
  File "/usr/lib/python2.5/site-packages/yum/depsolve.py", line 704, in resolveDeps
    for po, dep in self._checkFileRequires():
  File "/usr/lib/python2.5/site-packages/yum/depsolve.py", line 901, in _checkFileRequires
    for pkg in self.rpmdb.returnPackages():
  File "/usr/lib/python2.5/site-packages/yum/rpmsack.py", line 297, in returnPackages
    self._makePackageObject(hdr, idx)
  File "/usr/lib/python2.5/site-packages/yum/rpmsack.py", line 430, in _makePackageObject
    po = RPMInstalledPackage(hdr, index, self)
  File "/usr/lib/python2.5/site-packages/yum/rpmsack.py", line 37, in __init__
    YumInstalledPackage.__init__(self, rpmhdr)
  File "/usr/lib/python2.5/site-packages/yum/packages.py", line 1205, in __init__
    YumHeaderPackage.__init__(self, fakerepo, hdr)
  File "/usr/lib/python2.5/site-packages/yum/packages.py", line 981, in __init__
    self.summary = misc.share_data(self.hdr['summary'].replace('\n', ''))
AttributeError: 'list' object has no attribute 'replace'

Expected results:
Yum should update/remove/install.

Additional info:
Added two lines as per suggestion of fedora forums to /usr/lib/python2.5/site-packages/yum/packages.py to try and identify the bad packages.  Thought it might have been a rpm database corruption.

Find code
        self.summary = misc.share_data(self.hdr['summary'].replace('\n', ''))
add underneath
        print 'Here is the error with replace'
        print 'name = ', self.name

now I can see hundreds of packages which i can export to a list..  

If I do a rpm -Uvh --force packagename and re-run yum the package disappears from the list of packages yum listed.

I've done the following
yum clean all
reinstalled rpm/yum 
rpm --rebuilddb

Comment 1 aob.phantom 2008-12-02 03:53:36 UTC
Further tracking.

Decided to nuke the backup the /var/lib/rpm dir and use rpm --initdb 

Copied a number of files back and yum actually will now add / remove packages but I still have a broken rpm database.

Looks like part of the rpm database is screwed.

I've exported all packages with rpm -qa > packages.txt before starting.  I'm now in the process of running a forced upgrade on the exported list of packages to repair the damaged rpm database using rpm, which appears to be working slowly.

Any quick way of reinjecting the packages.txt back into the rpm database without the need for downloading and running a forced update on the packages ????

Comment 2 James Antill 2008-12-02 16:22:40 UTC

*** This bug has been marked as a duplicate of bug 473239 ***


Note You need to log in before you can comment on or make changes to this bug.