Skip to content

Commit 5f9e6ba

Browse files
committed
Add Amazon Linux support to installdependencies.sh
- Detect Amazon Linux via /etc/os-release ID check - Use dnf for Amazon Linux 2023, yum for Amazon Linux 2 - Fall back to /etc/system-release when /etc/redhat-release is missing
1 parent 3ffedab commit 5f9e6ba

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Misc/layoutbin/installdependencies.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,16 @@ then
117117
print_errormessage
118118
exit 1
119119
fi
120-
elif [ -e /etc/redhat-release ]
120+
elif [ -e /etc/redhat-release ] || grep -q '^ID="amzn"' /etc/os-release
121121
then
122122
echo "The current OS is Fedora based"
123-
echo "--Fedora/RHEL/CentOS Version--"
124-
cat /etc/redhat-release
123+
echo "--Fedora/RHEL/CentOS/Amazon Linux Version--"
124+
cat /etc/redhat-release 2>/dev/null || cat /etc/system-release 2>/dev/null
125125
echo "------------------------------"
126126

127-
# use dnf on fedora
128-
# use yum on centos and rhel
129-
if [ -e /etc/fedora-release ]
127+
# use dnf on fedora and amazon linux 2023
128+
# use yum on centos, rhel, and amazon linux 2
129+
if [ -e /etc/fedora-release ] || grep -q '^VERSION_ID="2023"' /etc/os-release
130130
then
131131
command -v dnf
132132
if [ $? -eq 0 ]

0 commit comments

Comments
 (0)