Is there any way to fix corrupted "yum"? This is what I got myself into by accidentally pressing ctrl+c while doing sudo yum update on an amazon linux EC2 instance

$ sudo yum update
Loaded plugins: priorities, update-motd, upgrade-helper
2216 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package glibc.i686 0:2.17-36.80.amzn1 will be updated
--> Processing Dependency: glibc = 2.17-36.80.amzn1 for package: glibc-common-2.17-36.80.amzn1.x86_64
---> Package glibc.x86_64 0:2.17-36.80.amzn1 will be updated
--> Processing Dependency: glibc = 2.17-36.80.amzn1 for package: glibc-common-2.17-36.80.amzn1.x86_64
---> Package glibc.i686 0:2.17-36.81.amzn1 will be an update
---> Package glibc.x86_64 0:2.17-36.81.amzn1 will be an update
---> Package glibc-devel.x86_64 0:2.17-36.80.amzn1 will be updated
---> Package glibc-devel.x86_64 0:2.17-36.81.amzn1 will be an update
---> Package glibc-headers.x86_64 0:2.17-36.80.amzn1 will be updated
---> Package glibc-headers.x86_64 0:2.17-36.81.amzn1 will be an update
---> Package nss-softokn-freebl.i686 0:3.14.3-9.15.amzn1 will be updated
---> Package nss-softokn-freebl.i686 0:3.16.0-1.19.amzn1 will be an update
---> Package perl-ExtUtils-Install.noarch 0:1.58-280.34.amzn1 will be updated
---> Package perl-ExtUtils-Install.noarch 0:1.58-280.36.amzn1 will be an update
--> Finished Dependency Resolution
Error: Package: glibc-common-2.17-36.80.amzn1.x86_64 (@amzn-main)
           Requires: glibc = 2.17-36.80.amzn1
           Removing: glibc-2.17-36.80.amzn1.i686 (@amzn-main)
               glibc = 2.17-36.80.amzn1
           Updated By: glibc-2.17-36.81.amzn1.i686 (amzn-updates)
               glibc = 2.17-36.81.amzn1
 You could try using --skip-broken to work around the problem
** Found 4 pre-existing rpmdb problem(s), 'yum check' output follows:
glibc-common-2.17-36.81.amzn1.x86_64 is a duplicate with glibc-common-2.17-36.80.amzn1.x86_64
glibc-common-2.17-36.81.amzn1.x86_64 has missing requires of glibc = ('0', '2.17', '36.81.amzn1')
nss-softokn-freebl-3.16.0-1.19.amzn1.x86_64 is a duplicate with nss-softokn-freebl-3.14.3-9.15.amzn1.x86_64
2:vim-filesystem-7.4.027-2.28.amzn1.x86_64 is a duplicate with 2:vim-filesystem-7.4.027-2.27.amzn1.x86_64
  • 2
    Is there a question here? – EEAA Apr 25 '14 at 0:55
  • There is now. And a legit one too, as rpm/yum can be nasty in this situation. – Dennis Kaarsemaker May 15 '14 at 11:37

You have duplicate packages, and maybe other corruptions too. Try these commands:

package-cleanup --cleandupes  # Removes duplicate packages
rpm --rebuilddb               # Rebuilds RPM database
yum reinstall glibc nss-softokn-freebl vim-filesystem

When that works, see if yum is happy:

yum check dependencies

If it's complaining about dependencies, install them first.

  • the amazon linux doesn't know --rebuilldb unfortunately, the rest didn't help :( – Ondrej May 16 '14 at 17:22
  • That was a misspelling, should be --rebuilddb – Dennis Kaarsemaker May 16 '14 at 18:08

Please try

sudo yum clean all
sudo yum update
  • didn't help, tried :( – Ondrej Apr 28 '14 at 14:12

nano /etc/yum.conf

Look for releasever=latest

If there is a comment(#), remove it.

Then retry the answer by Janne Pikkarainen above.

  • It is not commented :( – Ondrej May 16 '14 at 17:24
  • I would try to reinstall the system but I would have re-upload all the content that is not on github (only system is there) ... plus there seems to be loads of people with similar system – Ondrej May 16 '14 at 17:28
  • Do you have any 3rd party repo's? Try disabling all but the default AWS main and updates. – SilverSlugger May 16 '14 at 18:58

I was in the same boat after aborting a yum update that was working on glibc. Dennis Kaarsemaker pointed me in the right direction.

The OP didn't mark any of the answers as accepted. Just to corfirm which parts worked in my case:

The package-cleanup --cleandupes wouldn't comply and complained about packages that were protected.

The rpm --rebuilddb didn't give any output, so not sure if it contributed.

In my case the yum reinstall glibc did the trick, it completed the updates of glibc, and glibc-common that were left hanging.

I ran the package-cleanup --cleandupes again afterward, and this removed some old versions of packages, mainly glibc and the cantos release that were also left hanging in the aborted yum update.

  • 1
    How does your answer differ from that of Mr.Kaarsemaker? – Deer Hunter Apr 12 '15 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.