0

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
Ondrej Rafaj
  • 117
  • 1
  • 1
  • 4

4 Answers4

1

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.

Dennis Kaarsemaker
  • 19,277
  • 2
  • 44
  • 70
0

Please try

sudo yum clean all
sudo yum update
Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
0

nano /etc/yum.conf

Look for releasever=latest

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

Then retry the answer by Janne Pikkarainen above.

0

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.