T
T
TechNOIR2019-12-25 15:42:42
linux
TechNOIR, 2019-12-25 15:42:42

Centos 7. Error running yum update. How to fix?

Hello!
I'm trying to update packages on the server. I run yum update
I get:

Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
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 375, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 281, in main
    return_code = base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 817, in doTransaction
    resultobject = self.runTransaction(cb=cb)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1852, in runTransaction
    self.skipped_packages, rpmdb_problems, cmdline)
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 947, in beg
    pid   = self.pkg2pid(txmbr.po)
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 804, in pkg2pid
    return self._ipkg2pid(po, create)
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 798, in _ipkg2pid
    return self._pkgtup2pid(po.pkgtup, csum, create)
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 781, in _pkgtup2pid
    checksum))
  File "/usr/lib/python2.7/site-packages/yum/sqlutils.py", line 168, in executeSQLQmark
    return cursor.execute(query, params)
sqlite3.ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.

Has anyone come across? How to fix? Thanks in advance.
PS What I tried, but it helped
yum-complete-transaction
yum history new
rm -rf /var/cache/yum
yum clean all
rm -f /var/lib/rpm/__db*

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pcdesign, 2019-12-25
@pcdesign

After they removed:
You should probably do:
rpm -vv –rebuilddb

D
Drill, 2019-12-26
@Drill

This error is related to file system corruption. Specifically, there is corrupted information in the yum database.
rpm --rebuilddb won't help in this case.
You can find a corrupted database entry using the 'yumdb info' command
See an example here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question