AWS Linux EC2: yum won't run with plugins

16,482

This is most likely caused by a rogue entry in /etc/yum/pluginconf.d/

My first suggestion is to run through each of them in turn, setting 'enabled = 0' on each until the issue goes away, and you'll have found the culprit plugin, if this is the cause.

Alternatively, if this doesn't get you to a fix, increasing 'debug level' in /etc/yum.conf should give you further detail in /var/log/yum.log. The acceptable values are from 0 to 10.

Share:
16,482

Related videos on Youtube

Patrick
Author by

Patrick

Updated on September 18, 2022

Comments

  • Patrick
    Patrick over 1 year

    Short Version: yum commands on my Amazon Linux EC2 AMI only work with --noplugins.

    Long Version: A couple of days ago, I ran yum update at the behest of the SSH Login MoTD telling me I had updates to install. About midway through the update (specifically while updating the kernel), the update abruptly ended (79 of 138 items completed). The website I host on EC2 got weird for a few minutes, but eventually seemed to stabilize back out (maybe EC2 restarted itself?), and I didn't have further issues (other than MySQL started running out of memory, but I think that's probably unrelated to this).

    Today, I went to install gcc-c++ (with yum install gcc-c++). When I did, I got the following message:

    Loaded plugins: priorities, security, update-motd, upgrade-helper Config error: Command "updateinfo" already defined

    and I get that for any command I can think to run using yum. However, If I throw in the --noplugins flag, then magically it seems to work. To be clear, when I installed a different package a week ago, it worked totally correctly, so the yum update is the only thing I can think of that changed.

    I could find nothing on Google with regard to "updateinfo" already defined (with and without quotes). I tried running yum update --noplugins which spit out a message telling me that I should have run yum-complete-transaction instead, but proceeded to try to update something on its own. When that completed, I tried yum-complete-transaction but that gave me a message about the transactions not lining up correctly, so it removed the old transaction (Probably since I should have completed the first transaction before trying to update again, if I had known).

    Based on the SF question "Linux EC2 Broken Yum", I've also tried yum clean all --noplugins (fails the same with plugins) which just gives me

    Cleaning repos: amzn-main amzn-updates rpmforge
    Cleaning up everything

    I also tried

    package-cleanup --problems

    Loaded plugins: priorities, update-motd, upgrade-helper
    No Problems Found

    and

    package-cleanup --dupes
    Gives a lot of dupes, so I pasted them here: http://pastebin.com/VVFQEkTT instead of inline.

    At this point, I'm not sure what else there even is to check.

    • Admin
      Admin over 10 years
      This is a complete mess. It'll almost certainly be less work to start over with a fresh AMI.
    • Admin
      Admin over 10 years
      @MichaelHampton This one is EBS backed, can I just drop a new AMI onto my existing EBS? Are there risks to that? Should I choose a different AMI or stick with Amazon Linux? So many questions, heh
    • Admin
      Admin over 10 years
      You can snapshot EBS volumes and create a new volume from the snapshot, which can then be attached to any instance you wish. However, if indeed yum / rpmdb is mangledbeyond repair, there's no point in moving your existing root volume to be the root volume of another instance, as you're just bringing your problem with you. The only value in attaching this volume to another instance is that it will facilitate copying any data you'd like to keep onto your new instance.