Amazon Linux có phải là biến thể của Fedora?

Dẫn xuất của Hidrocacbon – Hydrocarbon derivatives – Hình minh họa

Amazon Linux là hệ điều hành Linux được AWS phát triển để cung cấp cho người dùng chạy miễn phí trên dịch vụ máy ảo EC2 của họ.

Amazon Linux có 2 phiên bản là Amazon Linux 2023 và Amazon Linux 2 AMI (HVM).

Amazon Linux 2023 AMI
Amazon Linux 2023 is a modern, general purpose Linux-based OS that comes with 5 years of long term support. It is optimized for AWS and designed to provide a secure, stable and high-performance execution environment to develop and run your cloud applications.

Amazon Linux 2 AMI (HVM) - Kernel 5.10, SSD Volume Type
Amazon Linux 2 comes with five years support. It provides Linux kernel 5.10 tuned for optimal performance on Amazon EC2, systemd 219, GCC 7.3, Glibc 2.26, Binutils 2.29.1, and the latest software packages through extras. This AMI is the successor of the Amazon Linux AMI that is now under maintenance only mode and has been removed from this wizard.

Amazon Linux là biến thể của Fedora theo thông tin từ /etc/os-release.

Nói cách khác Amazon dựa vào các phần mềm được đóng gói sẵn trong Fedora và đóng gói lại có thêm bớt, chỉnh sửa nào đó để ra mắt người đời với tên gọi mới là Amazon Linux.

cat /etc/os-release 
NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
SUPPORT_END="2028-03-15"

Linux kernel 6.1.66 được đóng gói và cài trong Amazon Linux 2023.

Bash shell version 5.2.15 được Amazon Linux đóng gói xài.

bash --version
GNU bash, version 5.2.15(1)-release (x86_64-amazon-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Amazon Linux xài công cụ đóng gói phần mềm RPM 4.16.1.3

rpm -qi rpm
Name        : rpm
Version     : 4.16.1.3
Release     : 12.amzn2023.0.6
Architecture: x86_64
Install Date: Wed Jan 17 21:22:20 2024
Group       : Unspecified
Size        : 2752678
License     : GPLv2+
Signature   : RSA/SHA512, Mon Apr 17 17:03:50 2023, Key ID e951904ad832c631
Source RPM  : rpm-4.16.1.3-12.amzn2023.0.6.src.rpm
Build Date  : Mon Apr 17 16:53:56 2023
Build Host  : ip-10-0-47-216.us-west-2.compute.internal
Packager    : Amazon Linux
Vendor      : Amazon Linux
URL         : http://www.rpm.org/
Summary     : The RPM package management system
Description :
The RPM Package Manager (RPM) is a powerful command line driven
package management system capable of installing, uninstalling,
verifying, querying, and updating software packages. Each software
package consists of an archive of files along with information about
the package like its version, a description, etc.

dnf là công cụ frontend của rpm phiên bản 4.12.0 trong Amazon Linux 2023.

Để các sysadmin đã quen với việc gõ lệnh yum hoặc các bash script cũ viết bằng lệnh yum vẫn chạy được thì người ta cho yum là symbolic link tới dnf.

ll `which yum dnf`
lrwxrwxrwx. 1 root root 5 Jan 31  2023 /usr/bin/dnf -> dnf-3
lrwxrwxrwx. 1 root root 5 Jan 31  2023 /usr/bin/yum -> dnf-3
 
dnf --version
4.12.0
  Installed: dnf-0:4.12.0-2.amzn2023.0.4.noarch at Wed Jan 17 21:23:03 2024
  Built    : Amazon Linux at Tue Jan 31 01:01:11 2023

  Installed: rpm-0:4.16.1.3-12.amzn2023.0.6.x86_64 at Wed Jan 17 21:22:20 2024
  Built    : Amazon Linux at Mon Apr 17 16:53:56 2023

dnf -q info dnf
Installed Packages
History database cannot be created, using in-memory database instead: SQLite error on "/var/lib/dnf/history.sqlite": Open failed: unable to open database file
Name         : dnf
Version      : 4.12.0
Release      : 2.amzn2023.0.4
Architecture : noarch
Size         : 2.2 M
Source       : dnf-4.12.0-2.amzn2023.0.4.src.rpm
Repository   : @System
Summary      : Package manager
URL          : https://github.com/rpm-software-management/dnf
License      : GPLv2+
Description  : Utility that allows users to manage packages on their systems.
             : It supports RPMs, modules and comps groups & environments.

Kho rpm được bật mặc định trong Amazon Linux là Amazon Linux 2023 repository và Amazon Linux 2023 Kernel Livepatch repository.

dnf repolist
repo id                                                              repo name
amazonlinux                                                          Amazon Linux 2023 repository
kernel-livepatch                                                     Amazon Linux 2023 Kernel Livepatch repository

dnf repolist all
repo id                                                    repo name                                                                                          status
amazonlinux                                                Amazon Linux 2023 repository                                                                       enabled
amazonlinux-debuginfo                                      Amazon Linux 2023 repository - Debug                                                               disabled
amazonlinux-source                                         Amazon Linux 2023 repository - Source packages                                                     disabled
kernel-livepatch                                           Amazon Linux 2023 Kernel Livepatch repository                                                      enabled
kernel-livepatch-source                                    Amazon Linux 2023 Kernel Livepatch repository - Source packages                                    disabled

Cài Apache HTTP Web server trên Amazon Linux 2023 coi sao.

dnf install httpd
Last metadata expiration check: 0:00:02 ago on Mon Jan 22 00:20:54 2024.
Dependencies resolved.
======================================================================================================================================================================
 Package                                     Architecture                   Version                                         Repository                           Size
======================================================================================================================================================================
Installing:
 httpd                                       x86_64                         2.4.58-1.amzn2023                               amazonlinux                          47 k
Installing dependencies:
 apr                                         x86_64                         1.7.2-2.amzn2023.0.2                            amazonlinux                         129 k
 apr-util                                    x86_64                         1.6.3-1.amzn2023.0.1                            amazonlinux                          98 k
 generic-logos-httpd                         noarch                         18.0.0-12.amzn2023.0.3                          amazonlinux                          19 k
 httpd-core                                  x86_64                         2.4.58-1.amzn2023                               amazonlinux                         1.4 M
 httpd-filesystem                            noarch                         2.4.58-1.amzn2023                               amazonlinux                          14 k
 httpd-tools                                 x86_64                         2.4.58-1.amzn2023                               amazonlinux                          81 k
 libbrotli                                   x86_64                         1.0.9-4.amzn2023.0.2                            amazonlinux                         315 k
 mailcap                                     noarch                         2.1.49-3.amzn2023.0.3                           amazonlinux                          33 k
Installing weak dependencies:
 apr-util-openssl                            x86_64                         1.6.3-1.amzn2023.0.1                            amazonlinux                          17 k
 mod_http2                                   x86_64                         2.0.11-2.amzn2023                               amazonlinux                         150 k
 mod_lua                                     x86_64                         2.4.58-1.amzn2023                               amazonlinux                          61 k

Transaction Summary
======================================================================================================================================================================
Install  12 Packages

Total download size: 2.3 M
Installed size: 6.9 M
Is this ok [y/N]: