AWS EC2 Linux Instance Cannot use "yum update"


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=""

asked 8 months ago488 views
1 Answer
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 (you need a login to view it).

Your exact issue is discussed in depth here

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
answered 8 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