Yum Errors

Home » CentOS » Yum Errors
CentOS 31 Comments

Hi,

I have a machine that recently had some file system corruption. fsck was able repair the file system but I am getting the following error when I try to do yum update:

[Errno 21] Is a directory: ‘/var/lib/yum/yumdb/e/2f883c08e3b596b66fcc19c6b4d73b11c9aaa43e-e2fsprogs-1.41.12-14.el6_4.2-x86_64/checksum_type’

In searching Google, some suggested renaming the yumdb but that just results in a traceback when I run yum.

There are some files in lost+found but I am not sure what the above file should look like and inode numbers are not useful to me.

Anyone have an idea how to fix this without reloading the machine?

Regards,

31 thoughts on - Yum Errors

  • Ok, I am still getting a traceback, obviously, the first traceback is expected but the last one os not. Below is what I did:

    (router pts4) # cd /var/lib/yum/
    (router pts4) # rm -r history/ yumdb/
    (router pts4) # ll total 12
    drwxr-xr-x. 3 root root 4096 May 6 11:31 repos drwxr-xr-x. 3 root root 4096 Jun 29 14:14 rpmdb-indexes
    -rw-r–r–. 1 root root 36 May 6 11:31 uuid
    (router pts4) # yum history new Loaded plugins: downloadonly, fastestmirror, security Traceback (most recent call last):
    File “/usr/bin/yum”, line 29, in
    yummain.user_main(sys.argv[1:], exit_code=True)
    File “/usr/share/yum-cli/yummain.py”, line 285, in user_main
    errcode = main(args)
    File “/usr/share/yum-cli/yummain.py”, line 136, in main
    result, resultmsgs = base.doCommands()
    File “/usr/share/yum-cli/cli.py”, line 438, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
    File “/usr/share/yum-cli/yumcommands.py”, line 1503, in doCommand
    ret = self._hcmd_new(base, extcmds)
    File “/usr/share/yum-cli/yumcommands.py”, line 1423, in _hcmd_new
    base.history._create_db_file()
    File “/usr/lib/python2.6/site-packages/yum/history.py”, line 1645, in _create_db_file
    cur.execute(op)
    sqlite3.OperationalError: table trans_beg already exists
    (router pts4) # yum history new Loaded plugins: downloadonly, fastestmirror, security history new
    (router pts4) # yum update Loaded plugins: downloadonly, fastestmirror, security Loading mirror speeds from cached hostfile
    * elrepo: elrepo.org Setting up Update Process Traceback (most recent call last):
    File “/usr/bin/yum”, line 29, in

    yummain.user_main(sys.argv[1:], exit_code=True)
    File “/usr/share/yum-cli/yummain.py”, line 285, in user_main
    errcode = main(args)
    File “/usr/share/yum-cli/yummain.py”, line 136, in main
    result, resultmsgs = base.doCommands()
    File “/usr/share/yum-cli/cli.py”, line 438, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
    File “/usr/share/yum-cli/yumcommands.py”, line 232, in doCommand
    return base.updatePkgs(extcmds, update_to=(basecmd == ‘update-to’))
    File “/usr/share/yum-cli/cli.py”, line 725, in updatePkgs
    self.update()
    File “/usr/lib/python2.6/site-packages/yum/__init__.py”, line 3735, in update
    updates = self.up.getUpdatesTuples()
    File “/usr/lib/python2.6/site-packages/yum/__init__.py”, line 906, in
    up = property(fget=lambda self: self._getUpdates(),
    File “/usr/lib/python2.6/site-packages/yum/__init__.py”, line 726, in _getUpdates
    self._up = rpmUtils.updates.Updates(self.rpmdb.simplePkgList(), self.pkgSack.simplePkgList())
    File “/usr/lib/python2.6/site-packages/yum/rpmsack.py”, line 502, in simplePkgList
    return self.pkglist
    File “/usr/lib/python2.6/site-packages/yum/rpmsack.py”, line 232, in _get_pkglist
    csumpkgtups = self.preloadPackageChecksums(load_packages

  • After doing a little more poking around, I moved /var/lib/yum/rpmdb-indexes out of the way and the issue seems to be solved. Yum seems to have recreated that directory and appears happy now.

    Does anyone know of a downside to doing this?

    Regards,

  • Yum clean all did not help. That was one of the first things I tried. Removing away /var/lib/yum/rpmdb-indexes resolved the issue.

    Thanks, to all who responded.

    Regards,

  • I have inherited CentOS 6.3 and 6.2 vms in an esxi environment. When I do

    yum provides ntpd

    on the 6.3 box I get a lot of errors like:

    Loaded plugins: fastestmirror, presto Loading mirror speeds from cached hostfile
    * base: mirror.unl.edu
    * extras: mirrors.cmich.edu
    * updates: mirror.steadfast.net http://mirror.unl.edu/CentOS/6.4/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 – “The requested URL returned error: 404”
    Trying other mirror. http://mirror.ash.fastserv.com/pub/linux/CentOS/6.4/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 – “The requested URL returned error: 404”

    Trying other mirror. http://mirrors.einstein.yu.edu/CentOS/6.4/updates/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.einstein.yu.edu/CentOS/6.4/updates/x86_64/repodata/repomd.xml: (28, ‘connect() timed out!’)
    Trying other mirror. http://mirrors.versaweb.com/CentOS/6.4/updates/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.versaweb.com/CentOS/6.4/updates/x86_64/repodata/repomd.xml: (28, ‘connect() timed out!’)
    Trying other mirror.

    Why am I getting these errors? I installed 6.4 in virtualbox and the .repo files seem the same, except the 6.3 box didn’t have a fastback.repo file. Also why is it looking at 6.4 repos above? When I see:

    cat /etc/redhat-release CentOS release 6.3 (Final)

    i.e., this box is 6.3. Shouldn’t it be looking for 6.3 repo info?

    Thanks,

    -wes

  • It should be looking at /6/ instead of a specific point release. We
    (CentOS) do not provide updates for individual point releases. You are several years behind in security and bug-fix updates. —
    Jim Perrin The CentOS Project | http://www.CentOS.org twitter: @BitIntegrity | GPG Key: FA09AD77

  • This is what happened:

    yum clean all Loaded plugins: fastestmirror, presto Cleaning repos: base extras updates Cleaning up Everything Cleaning up list of fastest mirrors
    8 delta-package files removed, by presto

    yum provides ntpd Loaded plugins: fastestmirror, presto Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os error was
    12: Timeout on http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os: (28, ‘connect() timed out!’)
    Error: Cannot find a valid baseurl for repo: base

    What next?

    Actually, I think I have a firewall issue. I googled the error and someone suggest trying:

    curl ‘http://mirrorlist.CentOS.org/?release=6&arch=i386&repo=os’ < http://mirrorlist.CentOS.org/?release=6&arch=i386&repo=os‘>

    So I tried that on my 6.4 virtualbox and it worked. I tried it on the esxi vm and it timed out.

    Thanks,

    -wes

  • Odd. I did:

    service iptables stop

    just to check the curl command again and it timed out again????

    iptables -L -n -v

    shows no rules

    service iptables start

    iptables -L -n -v

    shows rules again…

    -wes

  • I fixed the problem for now by editing /etc/yum.repos.d/CentOS-Base.repy, commenting out:

    mirrorlist=

    then finding a local university that has /6/ repo data and uncommenting and using:

    baseurl=

    I’m not sure why this box was having issues reaching mirrorlist.CentOS.org or even tracerouting to it???? It kept getting a different trace than my 6.4 virtualbox.

    Thanks,

    -wes

  • I finally just did yum update on this box (actually 6.3) and now it is 6.7. During the update it created a CentOS-Base.repo.rpmnew file. I renamed my current one and this one to just .repo and now I again get:

    —-

    yum update Loaded plugins: fastestmirror, presto Setting up Update Process Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os&infra=stock error was
    12: Timeout on http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os&infra=stock: (28, ‘connect() timed out!’)
    Error: Cannot find a valid baseurl for repo: base

    ——

    I thought updating to 6.7 might fix something, but it didn’t help. Any ideas why it is doing this?

    If I go to:

    http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os&infra=stock < http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os&infra=stock>

    in a browser, it shows a list of repos.

    Thanks,

    wes

  • I just noticed on a stock install of 6.7 (from 6.4 doing a test), doing yum update shows this:

    Loaded plugins: fastestmirror, refresh-packagekit, security

    But on the box I just updated it shows:

    Loaded plugins: fastestmirror, presto

    So maybe the presto plugin is causing the problem. Anyone else using presto plugin??

    -wes

  • That wasn’t it. I disabled presto then both with (and got the following error):

    yum update –disableplugin=presto,fast*
    Setting up Update Process Could not retrieve mirrorlist http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os&infra=stock error was
    12: Timeout on http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os&infra=stock: (28, ‘connect() timed out!’)
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

    Not sure what to try next. Other than my previous fix of not using a mirror list, but a known local repo that works fine for updates.

    -wes

  • Poking around I found:

    /etc/yum/pluginconf.d and now I see where presto comes from. I noticed in the fastmirror.conf there is a line

    hostfile-timedhosts.txt

    On my test box it has several lines of hosts with a number.

    On the box I’m have yum update issues, it is blank. ??

    -wes

  • Wes James wrote:

    Hi,

    I wasn’t sure if I should reply to you as you seem to be doing a pretty good job of helping your self here :-D.

    But jokes aside, can you do a couple of checks?

    Firstly, let’s make sure this machine actually has a network connection I’ve actually seen people spend hours trying to fix issues like yours only to find they had no outside network connection..

    $ ping 8.8.8.8

    Do you get a ping response? If not, check network settings. If you do, move on..

    $ ping google.com

    Does the domain resolve correctly? If not, check DNS settings. If you do, move on..

    Assuming both of those have worked, can you do the following:

    $ mkdir temporary
    $ cd temporary
    $ wget
    “http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os&infra=stock”

    (Don’t miss those quotes on the url, they are needed to ensure the &’s do not confuse BASH/ZSH)

    Now, what happened? Did it connect and download correctly? If so do the following:

    $ cat index.html\?release=6\&arch=x86_64\&repo=os\&infra=stock

    You should basically get the mirror list:

    http://mirrors.coreix.net/CentOS/6.7/os/x86_64/
    http://CentOS.serverspace.co.uk/CentOS/6.7/os/x86_64/
    http://mirrors.melbourne.co.uk/sites/ftp.CentOS.org/CentOS/6.7/os/x86_64/
    http://mirrors.vooservers.com/CentOS/6.7/os/x86_64/
    http://mirror.mhd.uk.as44574.net/mirror.CentOS.org/6.7/os/x86_64/
    http://www.mirrorservice.org/sites/mirror.CentOS.org/6.7/os/x86_64/
    http://mirrors.clouvider.net/CentOS/6.7/os/x86_64/
    http://mirrors.ukfast.co.uk/sites/ftp.CentOS.org/6.7/os/x86_64/
    http://mirror.cov.ukservers.com/CentOS/6.7/os/x86_64/
    http://mirror.as29550.net/mirror.CentOS.org/6.7/os/x86_64/

    With all of the above checks did you get expecting results including domain resolution, ping response and the mirror list contents?

    Kind Regards, Jake Shipton (JakeMS)
    Twitter: @CrazyLinuxNerd GPG Key: 0xE3C31D8F
    GPG Fingerprint: 7515 CC63 19BD 06F9 400A DE8A 1D0B A5CF E3C3 1D8F

  • Yes dns works. If I change this file

    /etc/yum.repos.d/CentOS-Base.repo

    to this:

    [base]
    name=CentOS-$releasever – Base
    #mirrorlist=http://mirrorlist.CentOS.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra baseurl=http://some.mirror.in.my.state/CentOS/$releasever/os/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

    it works to do updates (and the other baseurl lines in that file). It fails with the mirror list option.

    I have a CentOS 6.2 box here that is working just fine with updates and it looks very similar to this 6.7 box – updated from 6.3). I even tried going from static IP to dhcp assigned IP but no go.

    I just check /var/log/yum.log, but that doesn’t show any errors, just successful updates.

    -wes

  • finally something I can check for you my 6.x machine does not have the trailing &infra=$infra suggest you remove and try again

  • I use presto without problems. You can try disabling any plugin by going to /etc/yum/pluginconf.d and in the files there, change enabled from 1 to 0

  • What about the other thing he asked you to do:

    wget
    “http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os&infra=stock”

    Or even:

    nslookup mirrorlist.CentOS.org

    This sounds like you can not connect to the mirrorlist server or maybe you have a local dns name or an /etc/hosts entry that points to the wrong place.

  • nslookup works:

    Non-authoritative answer:
    Name: mirrorlist.CentOS.org Address: 108.61.16.227
    Name: mirrorlist.CentOS.org Address: 84.22.180.89
    Name: mirrorlist.CentOS.org Address: 88.150.173.218

    but wget fails??

    $ wget “http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os&infra=stock”
    –2015-12-08 08:04:15– http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os&infra=stock Resolving mirrorlist.CentOS.org… 199.187.126.90
    Connecting to mirrorlist.CentOS.org|199.187.126.90|:80… failed: Connection timed out. Retrying.

    On my CentOS 6.2 box, wget fails also, but yum update works fine.

    -wes

  • Hi,

    … why does your wget hit 199.187.126.90 when your DNS says
    108.61.16.227|84.22.180.89|88.150.173.218 ?

    Bad http proxy in the way?

    Tru

  • Another option I tried was

    service iptables stop

    just to see if there was a firewall rule causing an issue. But yum update still fails:

    yum update Loaded plugins: fastestmirror, presto Setting up Update Process Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os&infra=stock error was
    12: Timeout on http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os&infra=stock: (28, ‘connect() timed out!’)
    Error: Cannot find a valid baseurl for repo: base

  • Good point. When I do wget on a working repo (a working local repo in a US state), it works fine, but it errors out on the mirrorlist.CentOS.org, which is odd.

    I don’t need a proxy for this box, but is there a proxy file for wget that is fouling things up? I’ll check.

    Thanks,

    -wes

  • I just tried wget on my virtual box vm and it shows:

    wget “http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os”
    –2015-12-08 09:12:33– http://mirrorlist.CentOS.org/?release=6&arch=x86_64&repo=os Resolving mirrorlist.CentOS.org… 108.61.16.227, 84.22.180.89, 88.150.173.218, … Connecting to mirrorlist.CentOS.org|108.61.16.227|:80… connected. HTTP request sent, awaiting response… 200 OK
    Length: unspecified [text/plain]
    Saving to: “index.html?release=6&arch=x86_64&repo=os”

    [ < => ] 512 –.-K/s in 0s

    2015-12-08 09:12:34 (96.8 MB/s) – “index.html?release=6&arch=x86_64&repo=os” saved [512]

    Why is wget resolving to 199.187….. on these other systems?

    and nslookup shows the correct host resolution:

    $ nslookup mirrorlist.CentOS.org

    Non-authoritative answer:
    Name: mirrorlist.CentOS.org Address: 88.150.173.218
    Name: mirrorlist.CentOS.org Address: 84.22.180.89
    Name: mirrorlist.CentOS.org Address: 108.61.16.227

    Thanks,

    -wes

  • You wouldn’t happen to have an entry for mirrorlist.CentOS.org in your /etc/hosts file for some reason?

    Also, what is on the line for the (uncommented out) “hosts:” entry in your /etc/nsswitch.conf file?

LEAVE A COMMENT