If I run
docker run -it --rm --entrypoint=/bin/bash fedora:latest
dnf install moreutils
it works.
If I run:
19:57:34:~/ $ docker run -it --rm --entrypoint=/bin/bash public.ecr.aws/lambda/provided:al2023
bash-5.2# dnf install moreutils
dnf install moreutils
Downloading metadata...
error: No package matches 'moreutils'
bash-5.2#
it doesn't. Why?
These instructions refer to AL2: https://stackoverflow.com/questions/37951437/installing-moreutils-on-ec2-instance and don't work on Al2023 and enabling the suggested repo doesn't seem to do anything useful either:
22:46:20:~/ $ docker run -it --rm --entrypoint=/bin/bash public.ecr.aws/lambda/provided:al2023
bash-5.2# dnf --enablerepo epel install moreutils
dnf --enablerepo epel install moreutils
error: repo epel not found
bash-5.2#
AL2023 is based on Fedora. The question you linked actually refers to AL1, which was based on RHEL 6. It does not appear that any version of AL includes moreutils, which is why that other question recommended getting it from EPEL. EPEL doesn't explicitly support AL, but would sometimes work on AL1 and AL2 due to those being loosely based on RHEL. AL2023 is too different for EPEL packages to work.
The amazon-linux-2023 GitHub repo accepts issue reports and has a package request template. There has already been a request for moreutils. So your options at this point would be: