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
posta 8 mesi fa498 visualizzazioni
1 Risposta
2
Risposta accettata

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
ESPERTO
Steve_M
con risposta 8 mesi fa
  • 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!

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande