Unable to install services on my instance. Take Two.

0

What am I doing wrong?

I could have swore I am doing it right.

[ec2-user@localhost ~]$ sudo yum install -y telnet-server

Amazon Linux 2023 repository 0.0 B/s | 0 B 00:00 Errors during downloading metadata for repository 'amazonlinux':

Curl error (6): Couldn't resolve host name for https://al2023-repos-default-de612dc2.s3.dualstack.default.amazonaws.com/core/mirrors/2023.2.20231113/x86_64/mirror.list [Could not resolve host: al2023-repos-default-de612dc2.s3.dualstack.default.amazonaws.com] Error: Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://al2023-repos-default-de612dc2.s3.dualstack.default.amazonaws.com/core/mirrors/2023.2.20231113/x86_64/mirror.list [Could not resolve host: al2023-repos-default-de612dc2.s3.dualstack.default.amazonaws.com] Amazon Linux 2023 Kernel Livepatch repository 0.0 B/s | 0 B 00:00 Errors during downloading metadata for repository 'kernel-livepatch': Curl error (6): Couldn't resolve host name for https://al2023-repos-default-de612dc2.s3.dualstack.default.amazonaws.com/kernel-livepatch/mirrors/al2023/x86_64/mirror.list [Could not resolve host: al2023-repos-default-de612dc2.s3.dualstack.default.amazonaws.com] Error: Failed to download metadata for repo 'kernel-livepatch': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://al2023-repos-default-de612dc2.s3.dualstack.default.amazonaws.com/kernel-livepatch/mirrors/al2023/x86_64/mirror.list [Could not resolve host: al2023-repos-default-de612dc2.s3.dualstack.default.amazonaws.com] Ignoring repositories: amazonlinux, kernel-livepatch No match for argument: telnet-server Error: Unable to find a match: telnet-server

Please instruct me how to resolve this problem, instead of just linking me to rhetoric.

Filtering through a link's contents will only further confuse me, as I had this working once. AWS just decided to shut down all my instances, and deleted all my saved security groups and keypairs, so I am trying to replicate what i did before from nothing.

Hijak3k
已提問 10 個月前檢視次數 1301 次
2 個答案
1
已接受的答案

The DNS name al2023-repos-default-de612dc2.s3.dualstack.default.amazonaws.com can't be resolved, because it's invalid.

As to how this has happened .... the YUM repos are defined in files in the files in /etc/yum.repos.d/, the key bits are the rows of the form:

mirrorlist=https://al2023-repos-$awsregion-de612dc2.s3.dualstack.$awsregion.$awsdomain/core/mirrors/....

The shell variables should be expanded when the yum command is run, $awsregion should become the region the EC2 is provisioned in, and $awsdomain should become amazonaws.com.

The second one is happening on your EC2, the first one isn't (so it's being expanded to default instead).

In which region is the EC2 provisioned? And what are the contents of these files (they are ASCII text files so it's safe to cat them)?

/etc/dnf/vars/awsregion

/etc/dnf/vars/awsdomain

/etc/cloud/cloud.cfg.d/10_aws_dnfvars.cfg

/etc/yum.repos.d/amazonlinux.repo

Also (and this may not be related, but just in case) the shell prompt has changed from the expected ec2-user@ip-172-31-0-10 to ec2-user@localhost. What change was made on the system to effect this?

profile picture
專家
Steve_M
已回答 10 個月前
  • So, the fact that I am showing localhost instead of IP may be related to how I setup the incoming permissions?

    My old saved security groups were somehow deleted by AWS, and all my instances were shut down.

    I am trying to start over from scratch.

    Edit: I modified my permissions to Have SSH to MYIP and ALL Traffic for TCP, now the shall prompt shows my ip instead of localhost. Now I am seeing this:

    Errors during downloading metadata for repository 'amazonlinux':

  • So, the fact that I am showing localhost instead of IP may be related to how I setup the incoming permissions?

    No, I don't believe so. Fact is it may well not be anything to do with the issue at hand (errors running yum), but it's out-of-the-ordinary and it would be worth understanding why it's happening, in case it turns out there is a link.

    My old saved security groups were somehow deleted by AWS, and all my instances were shut down.

    That's unusual, and shouldn't normally have happened. Are you sure you are looking in the right region?

    Your yum problem remains, what are the contents those four text files requested in the original answer?

0

So the region was the problem. However, on the incorrect region, I was still unable to make a successful instance that actually worked.

Hijak3k
已回答 10 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南