AWS EC2 Linux Instance Cannot use "yum update"

0

I can't use "sudo yum update" to update the system, and it shows the following errors. Enter image description here I double-checked the security group and both inbound and outbound rules are set to allow for "all traffic". Also, "sudo yum clean all" command didn't help. How can I fix this? Any suggestions are appreciated, thanks.

cat /etc/os-release

NAME="Amazon Linux" VERSION="2" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2" PRETTY_NAME="Amazon Linux 2" ANSI_COLOR="0;33" CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2" HOME_URL="https://amazonlinux.com/"

Tank
asked 7 months ago437 views
1 Answer
2
Accepted Answer

Security groups and routing and all the rest of it are fine, because the yum command is able to go out and talk to the repos, identify the packages that it wants, and tries to download them.

Long-story-short - there's a utility called /usr/libexec/urlgrabber-ext-down that's key here, and it is either missing or it's set use a version of Python that is no longer on your system.

The official Red Hat solution (I know you're not running RHEL but it's very similar) is here https://access.redhat.com/solutions/5360161 (you need a login to view it).

Your exact issue is discussed in depth here https://unix.stackexchange.com/questions/355073/cannot-yum-install-any-packages

The solution boils down to one of either

  • does /usr/libexec/urlgrabber-ext-down exist? If it does then check first line of it (the #! entry) which should be something like #!/usr/bin/python. Does this (/usr/bin/python in this example) actually exist?

  • if /usr/libexec/urlgrabber-ext-down doesn't exist (or is a symlink pointing to a non-existent file) then recreate it ls -l /usr/libexec/urlgrabber-ext-down*. And then depending on the output ln -s /usr/libexec/urlgrabber-ext-down-[version] /usr/libexec/urlgrabber-ext-down

profile picture
EXPERT
Steve_M
answered 7 months ago
  • That explains it! I noticed that I have installed multiple versions of Python, and the program you mentioned "/usr/libexec/urlgrabber-ext-down" only works with python 2.7, so I switched back from Python 3.11 to Python 2.7, then the problem got solved! Thank you very much for the help, I appreciate it!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions