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
질문됨 8달 전498회 조회
1개 답변
2
수락된 답변

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
전문가
Steve_M
답변함 8달 전
  • 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!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠