amazonlinux / amazon-linux-2023

Amazon Linux 2023
https://aws.amazon.com/linux/amazon-linux-2023/
Other
501 stars 38 forks source link

[Bug] - `Amazon Linux 2023 Minimal Container image` AWS CLI2 installs a lot of packages, working as intended? #547

Closed r-heimann closed 7 months ago

r-heimann commented 7 months ago

Describe the bug Installing AWS CLI2 in the Amazon Linux 2023 Minimal Container image installs the following packages:

Details ``` + dnf install -y awscli-2 Package Repository Size Installing: awscli-2-2.9.19-1.amzn2023.0.1.noarch amazonlinux 10.0 MB expat-2.5.0-1.amzn2023.0.2.aarch64 amazonlinux 114.8 kB gdbm-libs-1:1.19-2.amzn2023.0.2.aarch64 amazonlinux 54.5 kB groff-1.22.4-7.amzn2023.0.2.aarch64 amazonlinux 1.2 MB groff-base-1.22.4-7.amzn2023.0.2.aarch64 amazonlinux 1.0 MB libxcrypt-4.4.33-7.amzn2023.aarch64 amazonlinux 129.8 kB mkpasswd-5.5.10-1.amzn2023.0.2.aarch64 amazonlinux 42.0 kB ncurses-6.2-4.20200222.amzn2023.0.4.aarch64 amazonlinux 404.4 kB paper-2.3-2.amzn2023.0.3.aarch64 amazonlinux 33.0 kB perl-AutoLoader-5.74-477.amzn2023.0.5.noarch amazonlinux 22.4 kB perl-B-1.80-477.amzn2023.0.5.aarch64 amazonlinux 185.0 kB perl-Carp-1.50-458.amzn2023.0.2.noarch amazonlinux 30.1 kB perl-Class-Struct-0.66-477.amzn2023.0.5.noarch amazonlinux 23.3 kB perl-Data-Dumper-2.174-460.amzn2023.0.2.aarch64 amazonlinux 56.1 kB perl-Digest-1.20-1.amzn2023.0.2.noarch amazonlinux 26.7 kB perl-Digest-MD5-2.58-2.amzn2023.0.2.aarch64 amazonlinux 37.5 kB perl-DynaLoader-1.47-477.amzn2023.0.5.aarch64 amazonlinux 27.0 kB perl-Encode-4:3.15-462.amzn2023.0.2.aarch64 amazonlinux 1.8 MB perl-Errno-1.30-477.amzn2023.0.5.aarch64 amazonlinux 15.9 kB perl-Exporter-5.74-459.amzn2023.0.2.noarch amazonlinux 32.2 kB perl-Fcntl-1.13-477.amzn2023.0.5.aarch64 amazonlinux 21.7 kB perl-File-Basename-2.85-477.amzn2023.0.5.noarch amazonlinux 18.2 kB perl-File-Copy-2.34-477.amzn2023.0.5.noarch amazonlinux 21.2 kB perl-File-Path-2.18-2.amzn2023.0.2.noarch amazonlinux 36.7 kB perl-File-Temp-1:0.231.100-2.amzn2023.0.2.noarch amazonlinux 61.2 kB perl-File-stat-1.09-477.amzn2023.0.5.noarch amazonlinux 18.2 kB perl-FileHandle-2.03-477.amzn2023.0.5.noarch amazonlinux 16.5 kB perl-Getopt-Long-1:2.52-2.amzn2023.0.2.noarch amazonlinux 61.5 kB perl-Getopt-Std-1.12-477.amzn2023.0.5.noarch amazonlinux 16.6 kB perl-HTTP-Tiny-0.078-1.amzn2023.0.3.noarch amazonlinux 57.2 kB perl-IO-1.43-477.amzn2023.0.5.aarch64 amazonlinux 89.4 kB perl-IO-Socket-IP-0.41-3.amzn2023.0.2.noarch amazonlinux 43.1 kB perl-IO-Socket-SSL-2.075-1.amzn2023.0.2.noarch amazonlinux 223.5 kB perl-IPC-Open3-1.21-477.amzn2023.0.5.noarch amazonlinux 24.0 kB perl-IPC-Run3-0.048-21.amzn2023.0.2.noarch amazonlinux 40.7 kB perl-MIME-Base64-3.16-2.amzn2023.0.2.aarch64 amazonlinux 32.0 kB perl-Mozilla-CA-20200520-4.amzn2023.0.2.noarch amazonlinux 13.0 kB perl-NDBM_File-1.15-477.amzn2023.0.5.aarch64 amazonlinux 23.2 kB perl-Net-SSLeay-1.92-2.amzn2023.0.2.aarch64 amazonlinux 376.6 kB perl-POSIX-1.94-477.amzn2023.0.5.aarch64 amazonlinux 99.8 kB perl-PathTools-3.78-459.amzn2023.0.2.aarch64 amazonlinux 87.6 kB perl-Pod-Escapes-1:1.07-458.amzn2023.0.2.noarch amazonlinux 20.9 kB perl-Pod-Perldoc-3.28.01-459.amzn2023.0.3.noarch amazonlinux 85.7 kB perl-Pod-Simple-1:3.42-2.amzn2023.0.2.noarch amazonlinux 220.4 kB perl-Pod-Usage-4:2.01-2.amzn2023.0.2.noarch amazonlinux 41.9 kB perl-Scalar-List-Utils-4:1.56-459.amzn2023.0.2.aarch64 amazonlinux 72.2 kB perl-SelectSaver-1.02-477.amzn2023.0.5.noarch amazonlinux 12.6 kB perl-Socket-4:2.032-1.amzn2023.0.2.aarch64 amazonlinux 56.8 kB perl-Storable-1:3.21-458.amzn2023.0.2.aarch64 amazonlinux 96.4 kB perl-Symbol-1.08-477.amzn2023.0.5.noarch amazonlinux 15.1 kB perl-Term-ANSIColor-5.01-459.amzn2023.0.2.noarch amazonlinux 49.4 kB perl-Term-Cap-1.17-458.amzn2023.0.2.noarch amazonlinux 22.9 kB perl-Text-ParseWords-3.30-458.amzn2023.0.2.noarch amazonlinux 17.0 kB perl-Text-Tabs+Wrap-2021.0726-1.amzn2023.0.1.noarch amazonlinux 23.0 kB perl-Time-Local-2:1.300-5.amzn2023.0.2.noarch amazonlinux 34.9 kB perl-URI-5.09-1.amzn2023.0.2.noarch amazonlinux 111.0 kB perl-base-2.27-477.amzn2023.0.5.noarch amazonlinux 17.2 kB perl-constant-1.33-459.amzn2023.0.2.noarch amazonlinux 23.9 kB perl-if-0.60.800-477.amzn2023.0.5.noarch amazonlinux 14.9 kB perl-interpreter-4:5.32.1-477.amzn2023.0.5.aarch64 amazonlinux 73.5 kB perl-libnet-3.13-2.amzn2023.0.2.noarch amazonlinux 128.9 kB perl-libs-4:5.32.1-477.amzn2023.0.5.aarch64 amazonlinux 2.1 MB perl-locale-1.09-477.amzn2023.0.5.noarch amazonlinux 14.6 kB perl-mro-1.23-477.amzn2023.0.5.aarch64 amazonlinux 29.3 kB perl-overload-1.31-477.amzn2023.0.5.noarch amazonlinux 47.2 kB perl-overloading-0.02-477.amzn2023.0.5.noarch amazonlinux 13.8 kB perl-parent-1:0.238-458.amzn2023.0.2.noarch amazonlinux 14.8 kB perl-podlators-1:4.14-458.amzn2023.0.2.noarch amazonlinux 114.8 kB perl-subs-1.03-477.amzn2023.0.5.noarch amazonlinux 12.6 kB perl-vars-1.05-477.amzn2023.0.5.noarch amazonlinux 13.9 kB psutils-2.05-1.amzn2023.0.2.noarch amazonlinux 51.8 kB python-unversioned-command-3.9.16-1.amzn2023.0.6.noarch amazonlinux 11.3 kB python3-3.9.16-1.amzn2023.0.6.aarch64 amazonlinux 28.6 kB python3-awscrt-0.16.7-1.amzn2023.0.1.aarch64 amazonlinux 1.4 MB python3-cffi-1.14.5-1.amzn2023.0.3.aarch64 amazonlinux 252.0 kB python3-colorama-0.4.4-2.amzn2023.0.2.noarch amazonlinux 33.8 kB python3-cryptography-36.0.1-1.amzn2023.0.3.aarch64 amazonlinux 1.2 MB python3-dateutil-1:2.8.1-3.amzn2023.0.2.noarch amazonlinux 296.1 kB python3-distro-1.5.0-5.amzn2023.0.2.noarch amazonlinux 36.8 kB python3-docutils-0.16-4.amzn2023.0.2.noarch amazonlinux 1.6 MB python3-idna-2.10-3.amzn2023.0.2.noarch amazonlinux 95.4 kB python3-jmespath-0.10.0-1.amzn2023.0.3.noarch amazonlinux 47.3 kB python3-libs-3.9.16-1.amzn2023.0.6.aarch64 amazonlinux 7.6 MB python3-pip-21.3.1-2.amzn2023.0.5.noarch amazonlinux 1.9 MB python3-pip-wheel-21.3.1-2.amzn2023.0.5.noarch amazonlinux 1.2 MB python3-ply-3.11-11.amzn2023.0.2.noarch amazonlinux 105.8 kB python3-prompt-toolkit-3.0.24-1.amzn2023.0.2.noarch amazonlinux 622.7 kB python3-pycparser-2.20-3.amzn2023.0.2.noarch amazonlinux 128.2 kB python3-pygments-2.7.4-1.amzn2023.0.2.noarch amazonlinux 1.9 MB python3-pysocks-1.7.1-8.amzn2023.0.2.noarch amazonlinux 34.7 kB python3-ruamel-yaml-0.16.6-5.amzn2023.0.2.aarch64 amazonlinux 193.9 kB python3-ruamel-yaml-clib-0.1.2-6.amzn2023.0.2.aarch64 amazonlinux 137.4 kB python3-setuptools-59.6.0-2.amzn2023.0.4.noarch amazonlinux 962.8 kB python3-setuptools-wheel-59.6.0-2.amzn2023.0.4.noarch amazonlinux 517.5 kB python3-six-1.15.0-5.amzn2023.0.2.noarch amazonlinux 37.2 kB python3-urllib3-1.25.10-5.amzn2023.0.2.noarch amazonlinux 178.7 kB python3-wcwidth-0.2.5-3.amzn2023.0.2.noarch amazonlinux 41.9 kB tzdata-2023c-1.amzn2023.0.1.noarch amazonlinux 443.9 kB whois-nls-5.5.10-1.amzn2023.0.2.noarch amazonlinux 34.5 kB Transaction Summary: Installing: 99 packages ``` Does AWS CLI2 really have that many dependencies? Is this working as intended?

To Reproduce Steps to reproduce the behavior:

  1. Install AWS CLI 2 in the AL2023 Minimal Container Image and check what it wants to install.

Expected behavior Not entirely sure, maybe less packages? According to the AWS CLI devs "perl-* packages are not related to the AWS CLI"

Screenshots -

Desktop (please complete the following information):

Smartphone (please complete the following information): -

Additional context Related to https://github.com/aws/aws-cli/issues/8317

nmeyerhans commented 7 months ago

It's the groff weak dependency that adds all these additional packages. This is needed for formatting the help output supported by the CLI. You can avoid installing it by leaving out weak dependencies, e.g. with dnf install awscli-2 --setopt=install_weak_deps=False. The tradeoff is that help no longer works:

bash-5.2# aws help

Could not find executable named "groff or mandoc"
bash-5.2# aws ec2 help

Could not find executable named "groff or mandoc"

So, I believe that things are, in fact, working as expected. groff is not strictly needed, which is why it's a weak dependency, but it's convenient, which is why it's installed by default.

In theory we could consider an alternate configuration for the container images in general that does not install weak dependencies by default, but I think that would be too big a surprise for most people. The container image should generally behave like any other Amazon Linux installation.

r-heimann commented 7 months ago

It's the groff weak dependency that adds all these additional packages. This is needed for formatting the help output supported by the CLI. You can avoid installing it by leaving out weak dependencies, e.g. with dnf install awscli-2 --setopt=install_weak_deps=False. The tradeoff is that help no longer works:

bash-5.2# aws help

Could not find executable named "groff or mandoc"
bash-5.2# aws ec2 help

Could not find executable named "groff or mandoc"

So, I believe that things are, in fact, working as expected. groff is not strictly needed, which is why it's a weak dependency, but it's convenient, which is why it's installed by default.

In theory we could consider an alternate configuration for the container images in general that does not install weak dependencies by default, but I think that would be too big a surprise for most people. The container image should generally behave like any other Amazon Linux installation.

Got it, learned something new today. Thank you!